5 ms·
UNIX Style, or cat -v Considered Harmful, http://harmful.cat-v.org/cat-v/ http://harmful.cat-v.org/cat-v/ (see the linked PDF, http://harmful.cat-v.org/cat-v/un
by dexen 7y ago
UNIX Style, or cat -v Considered Harmful, http://harmful.cat-v.org/cat-v/ http://harmful.cat-v.org/cat-v/ (see the linked PDF, http://harmful.cat-v.org/cat-v/unix_prog_design.pdf http://harmful.cat-v.org/cat-v/unix_prog_design.pdf)
Another example: the modern Bash shell vs the Plan 9's Rc shell. The difference in documentation is over tenfold, with the latter still being more less laden with gotchas:
$ man bash | wc -w
48189
$ 9 man rc | wc -w
3264
Having said that, I still love me some sick diff -burN-style mnemonics.
- MichaelMoser123 7y agobut rc doesn't have built in regex and doesn't have hash tables. My guess is that bash is trying to be a full scripting language these days, sort of like perl.
- MisterTea 7y agoBecause rc is a shell to run commands, hence the name rc, run command. For the tasks you mentioned you would use a program or language such as awk to handle those cases.
- dexen 7y ago>but rc doesn't have built in regex and doesn't have hash tables That's an advantage; Plan 9 provides awk for those use cases. There is a clear separation, and a simple yet powerful language for communication (pipes, file descriptors, and files). >bash is trying to be a full scripting language these days Arguably Bash over-did somewhere around the time they added support for TCP connections exec {FD}<>/dev/tcp/news.ycombinator.com/80; echo GET / >&$FD; cat <&$FD
- cat199 7y agoNot sure if arguing for plan9 simplicity by pointing out bashisms designed to emulate how one might use sockets on plan9/rc is the best strategy.
- AnIdiotOnTheNet 7y agoThe difference being that such functionality arose from the fundamentals of how plan9 worked, whereas bash hacked in a simulacrum.
- nimrody 7y agoActually, that's something that seems inspired by Plan 9 with its /net/tcp/xxx files. Bash just tries to make it cross platform so it cannot rely on the host OS like rc does.
- mprovost 7y agoThere were already netcat and similar tools that worked together with bash to provide this functionality.
- chubot 7y agoMaybe there was a clear separation 30 years ago, but there no longer is. The shortcut for the posts below is that you can write a Lisp in all of shell, awk, and make (and sed too) [1] I won't get to this in Oil (without help) but I still think it's valid. The languages have so much overlap that they should just be combined. Of course that's what Perl was (leaving out Make), but Raku and Python 3 seem to have left a hole in that design space. Shell, Awk, and Make Should Be Combined http://www.oilshell.org/blog/2016/11/13.html http://www.oilshell.org/blog/2016/11/13.html Example Code in Shell, Awk, and Make http://www.oilshell.org/blog/2016/11/14.html http://www.oilshell.org/blog/2016/11/14.html [1] https://github.com/kanaka/mal/tree/master/impls https://github.com/kanaka/mal/tree/master/impls
- m4r35n357 7y ago$ man dash | wc -w 10122 If you are running scripts most of the time bash is overkill (batch files don't need things like command completion, history and all that interactive stuff). Don't believe me? $ ls -lAh `which bash` -rwxr-xr-x 1 root root 1.1M Jun 6 2019 /bin/bash $ ls -lAh `which dash` -rwxr-xr-x 1 root root 119K Jan 25 2018 /bin/dash
- MisterTea 7y agoThe entirety of plan 9 cat is just 36 lines. That's true unix philosophy. Small tools that do one thing well which when combined produce more powerful tools. The -v flag is silly bloat as cat is nothing more than a program which catenates files.
- cmurphycode 7y agoThanks for the new addition to my mnemonic collection! perl -lane # process input by line, split into fields, print outputs with new lines, execute code netstat -planet # show process, extended info, all socket types ss -pimento # basically every piece of info about live connections iostat -txyz # extended, omit first report (the since-boot one), omit devices with no activity, log datetime
- dexen 7y agoImagine an old PS/2 mouse with a mini Jack cord & plug. Non-standard but works. I mean, on GNU/Linux: ps aux Party time: rsync -rave ssh SOURCE DESTINATION
- Izkata 7y agoless -SEXIER Truncate long lines instead of wrap, quit at eof, don't clear the screen, show ansi color escape codes as colors but escape other ansi escape codes. (The second E does nothing but complete the word)