30: 400 650 710
I have a one-liner that removes the number before the colon and substitutes any following number with this removed number.
Here is the one liner:
I run on Solaris9 and here is what I get (the desired result):perl -p -e 's/^([0-9]+)://g;$a=$1;s/\d+/$a/g' $CONF_FILE
30 30 30
On RHAS I get nothing returned. From intial debugging it appears the number before the colon is removed but not captured.
I say this because I try this modified one-liner to print the captured result:
On SUN I see the value printed (before the returned line of course):perl -p -e 's/^([0-9]+)://g;print $1' $CONF_FILE
30 400 650 710
But on Linux I do not see the captured value:
400 650 710
I need this to be portable - if anyone would be gracious enough to bestow any ideas upon me I would appreciate it very much!
Edited by planetscape - added code tags
In reply to One Liner works on SUN but not on Linux?? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |