Just to expand for *NIX shells, you need to avoid whitespace and other characters the shell is going to interpret specially: e.g. parens, curlies, braces, splats, dolar signs, ampersands, semicolons, and backslashes (and that's in no ways an exhaustive list). Usually you can backslash them to escape them, but you're going to wind up with leaning toothpick syndrome. It'll be much simpler (to say nothing of fewer characters) if you just break down and (single) quote things and be done with it.
$ uptime | perl -nE m\{\(load\ averages:.\*\)\}\&\&say\$1 load averages: 1.12 1.02 0.95 $ uptime | perl -nE 'm{(load averages:.*)}&&say$1' load averages: 0.84 0.96 0.93
(Insert Jurasic Park quote about could versus should)
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re^2: one liner error
by Fletch
in thread one liner error
by toohoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |