7 ms·
I don't love the $...$ syntax for executing commands. Using $ as a string delimiter is very strange to my bash-accustomed eyes. It's a shame that they provided
by manlobster 2y ago
I don't love the $...$ syntax for executing commands. Using $ as a string delimiter is very strange to my bash-accustomed eyes.
It's a shame that they provided such weird syntax for the most important thing you tend to do in a bash script, while providing fairly nice syntax for everything else.
- chii 2y agoand i dont like how it's inconsistent that echo is not using the $ syntax (which makes sense internally, as it's a built-in, rather than executing the $echo command). Overall, it is cute and neat, but i find that if you are looking to write bash scripts that require this level of programming, you'd be better off writing it in python, or perl. Only in very austere environments can this be utilized, but the requirement of having `bc` installed means you must also have the ability to run package installation, so might as well run the package installation for a full on programming language!
- chrisjharris 2y agoI think that this does fill a niche. You can still compile to bash outside of this austere environment, and run the scripts within it. And python isn't very ergonomic for running external shell commands (or, say accessing environment variables), the syntax for doing so in amber looks much neater.
- freedomben 2y ago> the requirement of having `bc` installed means you must also have the ability to run package installation I don't remember ever installing bc, but I use it frequently and it's always there. Are you sure it's not already part of most base systems?
- mayli 2y agoNo, it's often not, it's one of the common package you install manually to compile a linux kernel
- rascul 2y agoIt's part of posix and should be available anywhere a posix like environment is offered.
- tredre3 2y agoIt's not pre-installed on Debian and SUSE.
- lelanthran 2y ago> I don't remember ever installing bc, but I use it frequently and it's always there. Are you sure it's not already part of most base systems? In my bash scripts, using `bc` makes my script not work on git-bash under Windows. Almost everything else I do in a script that isn't linux-specific (including netcat/nc usage) runs in git-bash for Windows.
- RodgerTheGreat 2y agoShelling out to awk would be a more portable choice than bc, though awk would bring you much closer to the featureset of Amber to begin with.