3 ms·
If you find sed useful I would encourage you to check out Perl (https://www.perl.org/ https://www.perl.org/). It has all of the powerful regular expression cap
by thesuperbigfrog 7y ago
If you find sed useful I would encourage you to check out Perl (https://www.perl.org/ https://www.perl.org/).
It has all of the powerful regular expression capabilities that sed has plus much more.
- claes-magnus 7y agoYou should enjoy my post from yesterday: https://herebeseaswines.net/essays/2020-04-18-a-bash-perl https://herebeseaswines.net/essays/2020-04-18-a-bash-perl Yes, I wanna learn Perl! :)
- thesuperbigfrog 7y agoIf you are familiar with JavaScript then you should be able to be productive with Perl pretty quickly. I recommend the reading "Programming Perl" (the Camel book) or "Learning Perl", both from O'Reilly press. If you are using a Mac or Linux system, you probably already have Perl installed, so there is no setup to start using it.
- claes-magnus 7y agoYes, I have it (I am on a Linux). Thank you for sharing! :) Cheers!
- montroser 7y agoI think the Bash vs Perl example there is not exactly fair, since in Perl you're not assigning to ls_output first. You could do the same in bash, and it's arguably just as expressive: (( `ls | wc -l` > 100 )) && echo "many files" || echo "few files"
- claes-magnus 7y agoNice!!! I am very grateful. Thank you for sharing! I did not know you could solve it like so. And yes, this is very expressive!