3 ms·
Nothing is quite as succinct as shell. The python equivalent to this would probably be at least 10 lines of code.
by jniedrauer 6y ago
Nothing is quite as succinct as shell. The python equivalent to this would probably be at least 10 lines of code.
- tyingq 6y agoEveryone 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.
- yjftsjthsd-h 6y agohttps://news.ycombinator.com/item?id=24558719 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.)