News for hackers. Stuff that matters.
Re:The growth of command-line options, 1979-Present by dexen on Tuesday March 03, 2020 @08:46AM (#22474362)
UNIX Style, or cat -v Considered Harmful, http://harmful.cat-v.org/cat-v/ (see the linked 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.
Re:The growth of command-line options, 1979-Present by cmurphycode on Tuesday March 03, 2020 @09:15AM (#22474573)
Thanks 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

Re:The growth of command-line options, 1979-Present by Izkata on Tuesday March 03, 2020 @04:17PM (#22478805)

  less -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)

Re:The growth of command-line options, 1979-Present by dexen on Tuesday March 03, 2020 @09:31AM (#22474708)
Imagine 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
Re:The growth of command-line options, 1979-Present by anthk on Tuesday March 03, 2020 @01:30PM (#22477329)
I use -avz
Re:The growth of command-line options, 1979-Present by dmckeon on Tuesday March 03, 2020 @06:48PM (#22479887)
Aww, shucks: rsync -aSHx src/ dest
Re:The growth of command-line options, 1979-Present by MisterTea on Tuesday March 03, 2020 @09:01AM (#22474459)
The 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.
Re:The growth of command-line options, 1979-Present by m4r35n357 on Tuesday March 03, 2020 @08:55AM (#22474421)

  $ 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
Re:The growth of command-line options, 1979-Present by MichaelMoser123 on Tuesday March 03, 2020 @08:53AM (#22474411)
but 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.
Re:The growth of command-line options, 1979-Present by dexen on Tuesday March 03, 2020 @09:26AM (#22474656)
>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
Re:The growth of command-line options, 1979-Present by chubot on Tuesday March 03, 2020 @04:08PM (#22478733)
Maybe 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

Example Code in Shell, Awk, and Make http://www.oilshell.org/blog/2016/11/14.html

[1] https://github.com/kanaka/mal/tree/master/impls

Re:The growth of command-line options, 1979-Present by nimrody on Tuesday March 03, 2020 @11:26AM (#22475911)
Actually, 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.
Re:The growth of command-line options, 1979-Present by mprovost on Tuesday March 03, 2020 @12:30PM (#22476640)
There were already netcat and similar tools that worked together with bash to provide this functionality.
Re:The growth of command-line options, 1979-Present by cat199 on Tuesday March 03, 2020 @10:52AM (#22475481)
Not 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.
Re:The growth of command-line options, 1979-Present by AnIdiotOnTheNet on Tuesday March 03, 2020 @02:01PM (#22477642)
The difference being that such functionality arose from the fundamentals of how plan9 worked, whereas bash hacked in a simulacrum.
Re:The growth of command-line options, 1979-Present by MisterTea on Tuesday March 03, 2020 @09:05AM (#22474490)
Because 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.