Hacker News new | ask | show | jobs
by cyberdelica 1556 days ago
Sorry, I completely disagree with practically everything you wrote above.

There’s nothing complicated, oblique, or arcane, about short options - if one is versed in Unix.

Usually, the sentiment you’ve expressed, comes from the mouthes of developers, more comfortable with Windows, and/or Python - regurgitating cargo cult lore, parrot fashion - sometimes followed with another regurgitated quip, about moving to a “proper” language, if said script, exceeds n lines. A similar phenomenon, can be seen with the Zawinski quote, regarding regex - usually parroted by people who have not learnt regex.

If one wants to leave supplementary information, regarding the invocation of anything within a shell script, there is already the facility to do such - comments - which take the same form, as comments within the Python language.

Your assertion that Bash is a dead language, is absurd. Particularly when juxtaposed with your assertion concerning Z Shell, immediately thereafter - which is practically identical to Bash, in syntax, aside from a few differences.

Command options, short or long, are not even shell specific. They’re a Unix convention. Why should the writer of a shell script, be at all concerned, with anyone who hasn’t grasped the fundamental basics of working with the platform, for which the script is intended to operate?!

Personally, I’m of the opinion that long options, are GNU bloat.

As for the linked Github repo - getopts - it’s builtin.

1 comments

> There’s nothing complicated, oblique, or arcane, about short options - if one is versed in Unix.

Need to list a directory reversively?

  ls -R
Need to list a directory in reverse?

  ls -r
Need to sort a list in reverse?

  sort -r
Need to grep recursively?

  grep -r
Need to copy recursively?

  cp -R
  cp -r  # obsolete!
Definitely not confusing!
> Definitely not confusing!

Heh, well... I never said it wasn’t confusing. I agree with you on the above.

If the Unix Philosophy was being properly followed, with your ls example, as a case in point, I would use:

    ls | tac | column
Now, that’s not even considering the ridiculousness of the naming of the “tac” command, which would ideally be renamed “rev” - with rev ideally being expanded, to to ALL reversals, not just character based, per line.

The sort of nonsense above, is why I started writing my own core utils and OS from scratch - which I suppose is a sort of suckless meme, by now.

POSIX, is both a blessing, and a curse.

Thank you, I was trying not to feed the trolls. ;-)

http://www.robertames.com/blog.cgi/entries/the-unix-way-comm...

...I link to some good references that I found w.r.t. command line options which was a useful baseline even for looking at what options your command may try to support.

> Thank you, I was trying not to feed the trolls. ;-)

Who’s the troll? Your comment is probably out of line with site guidelines mate. Please report yourself to the admins, for attitude realignment.