Re:No script is too simple
by jniedrauer on Tuesday September 22, 2020 @02:55PM
(#24558414)
Nothing is quite as succinct as shell. The python equivalent to this would probably be at least 10 lines of code.
[ Parent
| on HN ]
Everyone tends to rag on Perl, but it's excellent in this space.
Edit: The equivalent of above would be:
#!/usr/bin/perl
my $shell=(getpwuid($>))[8];
print "$shell\n";
Though it does have simple syntax for pipes as well.
Re:No script is too simple
by yjftsjthsd-h on Tuesday September 22, 2020 @03:55PM
(#24559069)
https://news.ycombinator.com/item?id=24558719 does it in 5, which is, I think, proof that you're both right. (Of course, perhaps shell is cheating, since I chained 3 commands into that one-liner, and 2 of those are really their own languages with further subcommands.)