|
Notorious b.s.d. posted:/bin/case haha, not sure how case could be implemented without being built in to the shell. true, false, test, [, etc., sure. VikingofRock posted:God I can never remember the difference between [ and [[ [[ is the one you want, [ is legacy
|
# ? Oct 1, 2017 06:07 |
|
|
# ? May 26, 2024 03:26 |
|
[[ supports regexes and i believe some other additional operators, i'd have to consult bash(1) for more specifics
|
# ? Oct 1, 2017 06:12 |
|
[quote="“There Will Be Penalty”" post="“476936137”"] [[ supports regexes and i believe some other additional operators, i’d have to experiment a bunch before giving up and going to snack overflow for more specifics [/quote]
|
# ? Oct 1, 2017 06:22 |
|
There Will Be Penalty posted:haha, not sure how case could be implemented without being built in to the shell. POSIX/SuS documents case/esac as builtins.
|
# ? Oct 1, 2017 06:39 |
|
If you're one of those people who still insists to put #!/bin/sh in tyool 2017 but then uses bashisms in the script you should be drawn and quartered i m o
|
# ? Oct 1, 2017 08:18 |
|
VikingofRock posted:God I can never remember the difference between [ and [[ [ is the name of an external executable which was created as a workaround for the fact that the earliest versions of Bash literally had no way to compare variables with one another. [[ is the actual Bash syntax which was introduced later to meet this need.
|
# ? Oct 1, 2017 15:45 |
|
Suspicious Dish posted:nah /etc/ doesn't have binaries /etc used to have binaries on hp-ux it probably still does
|
# ? Oct 1, 2017 15:48 |
|
shell scripting is really bad friends don't let friends write new shell scripts
|
# ? Oct 1, 2017 15:48 |
|
[quote="“Notorious b.s.d.”" post="“476942746”"] shell scripting is really bad friends don’t let friends write new shell scripts [/quote] for small stuff it beats dealing with pip
|
# ? Oct 1, 2017 16:25 |
|
Progressive JPEG posted:for small stuff it beats dealing with pip python without pypi is still more capable than shell the base python distribution has everything bash will do for you, and more
|
# ? Oct 1, 2017 16:28 |
|
Notorious b.s.d. posted:python without pypi is still more capable than shell python 2 or python 3?
|
# ? Oct 1, 2017 17:03 |
|
Progressive JPEG posted:python 2 or python 3? don't care both better than bash
|
# ? Oct 1, 2017 17:04 |
|
python is better documented too
|
# ? Oct 1, 2017 17:33 |
|
yeah don't get me wrong id rather use python in nearly all cases, but if the task is solved in 5 lines of bash then it's gonna be bash
|
# ? Oct 1, 2017 18:47 |
|
Progressive JPEG posted:yeah don't get me wrong id rather use python in nearly all cases, but if the task is solved in 5 lines of bash then it's gonna be bash if you’re just stringing a bunch of utilities and calling a bunch of command lines, it makes no sense to write a python script if you’ve got other stuff to take care of today
|
# ? Oct 1, 2017 19:19 |
|
|
# ? Oct 1, 2017 20:51 |
|
Doom Mathematic posted:[ is the name of an external executable which was created as a workaround for the fact that the earliest versions of Bash literally had no way to compare variables with one another. nonsense [ is builtin syntax in bash. there also exists an external executable of that name for historical reasons but using "if [ something ]" in a script does not spawn another process and never has in bash. [[ is a nonstandard bash extension that exists because they couldn't add all their special snowflake gnu features to [ while remaining mostly posix compliant. it should be avoided if you are writing portable shell scripts, although you'd have to be an idiot to write a portable shell script any time in the last two decades or so
|
# ? Oct 2, 2017 09:29 |
|
Soricidus posted:[ is builtin syntax in bash. Then why isn't Bash code:
|
# ? Oct 2, 2017 10:37 |
|
Doom Mathematic posted:Then why isn't i just tested this: the real /usr/bin/[ will raise an error. bash builtin [ is cool with it. this is roughly example 9 million and 1 of shell scripting being horrible. mothers, don't let your sons grow up to write shell.
|
# ? Oct 2, 2017 15:04 |
|
Speaking of which, whatever happened to Tcl anyway? It suddenly became deeply unfashionable for some reason.
|
# ? Oct 2, 2017 15:48 |
|
yeah, seems one of those weird moments of history, it really was a pretty sensible middle-ground between full programming and command processing which anyone could write with minimal training. not to mention that there was a long period where tk was basically about as good as unix gui programming got i mostly suspect it died out due to not getting the nerd cred of more full-programming-language competitors, despite that not quite being the point
|
# ? Oct 2, 2017 16:04 |
|
I blame all those lovely eggdrop scripts that never worked without a rewrite
|
# ? Oct 2, 2017 17:04 |
|
The only reason to write a shell script is: - Doing a series of bash steps over and over quickly. If your bash script has any loops or more logic than: if !, you should be using a better language.
|
# ? Oct 2, 2017 17:26 |
|
if your shell script has a control flow graph then gently caress you if you are literally just setting up a bunch of env vars and pipelines and command line args then i guess shell is fine
|
# ? Oct 2, 2017 17:28 |
|
Sapozhnik posted:if your shell script has a control flow graph then gently caress you
|
# ? Oct 2, 2017 17:32 |
|
initrd images are one of the few places where it is suitable to write a new shell script with relatively complex logic
|
# ? Oct 2, 2017 17:32 |
|
The last S3TC patent expires today, so it must truly be the year of Linux on the desktop.
|
# ? Oct 2, 2017 18:01 |
|
things that I have ever used tcl for: 1. expect scripts 2. fixing a bit in git-gui in both cases it struck me as non terrible and I could understand why those tools used it
|
# ? Oct 2, 2017 18:34 |
|
Soricidus posted:things that I have ever used tcl for: 3. irc bot
|
# ? Oct 2, 2017 18:37 |
|
tcl is ok for real short stuff but I'm frequently annoyed by it when writing longer scripts that have to manipulate data. I have to do this because xilinx tools use tcl as an embedded scripting language. there is no bridging to anything else, hope u like tcl friendo for calibration purposes, annoyed means I often find myself wishing it had the features and documentation quality of perl
|
# ? Oct 2, 2017 20:50 |
|
Lysidas posted:initrd images are one of the few places where it is suitable to write a new shell script with relatively complex logic nope. There's systemd for that.
|
# ? Oct 2, 2017 23:27 |
|
BobHoward posted:tcl is ok for real short stuff but I'm frequently annoyed by it when writing longer scripts that have to manipulate data. I have to do this because xilinx tools use tcl as an embedded scripting language. there is no bridging to anything else, hope u like tcl friendo I've done an awful lot of Vivado scripting - my takeaway is that TCL is actually a p. dece language, except for the fact that it's completely unlike everything else out there. also I'm not the biggest fan of "everything is a string" scripting languages Poopernickel fucked around with this message at 01:32 on Oct 3, 2017 |
# ? Oct 3, 2017 01:30 |
|
BobHoward posted:for calibration purposes, annoyed means I often find myself wishing it had the features and documentation quality of perl perl5 is far less bad than its reputation suggests. it's usually the first thing I reach for when a bash script becomes complicated enough to need replacing with an actual program. I wouldn't use it for much else these days but it's very good for that specific task
|
# ? Oct 3, 2017 02:23 |
|
perl5 is good
|
# ? Oct 3, 2017 02:27 |
|
Soricidus posted:perl5 is far less bad than its reputation suggests. it's usually the first thing I reach for when a bash script becomes complicated enough to need replacing with an actual program. I wouldn't use it for much else these days but it's very good for that specific task perl5 gets a ton of unwarranted hate. you shouldn't build applications with it (though it's not much worse at it than any other p-lang and everyone seems to be fine with those, whatever) but it's great at glueing things together or monkeying with text and often way nicer than the equivalent chaining stuff together in bash. perl6 seems pretty bad though.
|
# ? Oct 3, 2017 02:33 |
|
jony neuemonic posted:perl5 gets a ton of unwarranted hate. you shouldn't build applications with it (though it's not much worse at it than any other p-lang and everyone seems to be fine with those, whatever) but it's great at glueing things together or monkeying with text and often way nicer than the equivalent chaining stuff together in bash. quote:perl6 seems pretty bad though.
|
# ? Oct 3, 2017 02:47 |
|
jony neuemonic posted:perl5 gets a ton of unwarranted hate. you shouldn't build applications with it (though it's not much worse at it than any other p-lang and everyone seems to be fine with those, whatever) but it's great at glueing things together or monkeying with text and often way nicer than the equivalent chaining stuff together in bash.
|
# ? Oct 3, 2017 02:56 |
|
|
# ? Oct 3, 2017 02:57 |
|
looked at the copyright date and i cannot loving believe perl6 has been around that long
|
# ? Oct 3, 2017 03:13 |
|
|
# ? May 26, 2024 03:26 |
|
ocaml
|
# ? Oct 3, 2017 04:51 |