Add Bash language support

Back to General discussions forum

dangarciahe     2023-10-03 16:34:44
User avatar

Hello, Rodion. I hope you are doing well :)

I recently challenged myself to learn and practice some Bash. Motivated by veen's post about Vala support, I'm asking you if you can please add Bash to the list of languages used to mark solutions, so we can use that instead of other.

Greetings, Daniel.

TestUser     2023-10-03 18:46:37
User avatar

It's me, Rodion, just testing some minor changes

Hi Daniel! I agree, this makes sense and shouldn't be difficult - but should we add bash explicitly or any shell-scripting language? I remember for example sdf.org provides opportunity to create scripts including CGI using ksh for example... Obviously I also amused myself with bash etc scripting some time ago (besides using bash for casual needs) - but found it somewhat slow (ksh faster but still slow) - still it is curious experience :)

dangarciahe     2023-10-03 20:04:55
User avatar

Hello, Rodion

I didn't knew about sdf.org, thanks!. I think adding support for any shell language could be better, as it is more global and there won't be hundreds of shell languages in the selection. Also, bash doesn't support floating point arithmetics, and that can be specially problematic with some of the problems here.

Rodion (admin)     2023-10-03 20:27:42
User avatar

Daniel, Hi again!

I think now shell (and vala, let it be, he-he) should appear in the list. Seemingly i didn't forget to add it anywhere else and it should just work - tell at once if not :)

Good point about floating point! When dealing with bash actually one often feels need to use some external small utilities for various operations. Though probably at least some problems with floating point values could be solved using integers instead, just converting input and output may be somewhat painful. On the other hand it is a funny challenge to discuss in your study group. Perhaps I'll try to take part later and solve something in bash :)

dangarciahe     2023-10-04 14:02:30
User avatar

Yeap, it is working as expected. See you around solving problems with Bash :)

Thanks for adding it :)

TestUser     2023-10-05 09:00:15
User avatar

Ohm, I accepted this as mini-challenge and tried to code next-unsolved problem in this account (Triangles).

Well, it doesn't take that much time, but I needed to google almost everything. How to split string to values, how to deal with array. Probably this could become comfortable when one learns more of Bash (and prepares useful subroutines for sorting, splitting etc). But for beginner like me it is somewhat harder than Perl :)))

Perhaps I'd better pick some problem with floats to try it with bash...

Please login and solve 5 problems to be able to post at forum