Hacker News new | past | comments | ask | show | jobs | submit login

Nothing is quite as succinct as shell. The python equivalent to this would probably be at least 10 lines of code.



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.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: