in reply to getting the tail of a string
Unfortunately i can not use $POSTMATCHs shortform $' on command line.
Sure you can. You just have to be a little more creative about how you get it in there. The way to do it is to end the single quoted portion of the command line, put another single quote but escape it, and continue on if necessary with another single quote. with the example you gave, that would be:
A shorter example for illustration:perl -we '$x="j::/tmp/lz/ncak.030610.141654";$x=~/.+\// && print $'\'
And to illustrate putting more after that...perl -le '$_="abc";/b/;print $'\' | ^--- the single quote part of $' +--- the dollar part of $'
perl -le '$_="abc";/b/;print $'\'';print "more"'
-sauoq "My two cents aren't worth a dime.";
|
|---|