Changes

Jump to navigation Jump to search
493 bytes added ,  11:16, 25 March 2016
Adds perl pie example
Sometimes one-liners are so cool, you just want to remember them. And good one-liners can also teach you the intricacies and features of the [[Bash]] shell. Although there are better sites on the Internet for [http://www.bashoneliners.com/ finding one-liners], [http://www.catonmat.net/series/bash-one-liners-explained understanding one-liners] or [http://uni.xkcd.com/ playing on the command line], we'd still like to illustrate a few here.
 
== Perl edit ==
Sometimes you want to make a bunch of changes (substitutions) of the same text across multiple files. Like changing a product name across multiple pages of documentation. With a one-line perl command, you can do just that. Furthermore, the example below uses a <code>ls</code> command to select which files to operate on -- giving you even more powerful control over your one-line edit.
<source lang="perl">
perl -p -i -e "s/lemons/lemonade/" $(/bin/ls my/life*)
</source>
== Free Memory ==
4,558

edits

Navigation menu