in reply to substituting a regular expression in a file

Does your command line work without being wrapped in Perl?

rsh sdp2 perl -pi -e 's\/^(command\.package)\=(\\S+)\/\"\$1\=1.0.0.0\" +\/gei' $ENV{JBOSS_HOME}/install/version.properties

I'd bet you have a quoting/interpolation issue, and getting it to work without being wrapped in a Perl system call might get you on your way.



--chargrill
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

Replies are listed 'Best First'.
Re^2: substituting a regular expression in a file
by Fletch (Bishop) on Sep 06, 2006 at 13:13 UTC

    Seconded on it being a quoting issue. In general when you've got something harry like this that's going to get passed through several shells it's best to stick the part that needs quoting in its own script on the remote side. Then you simply run that script rather than trying to divine how many different layers of backwhacks and quotes and double quotes (and tigers and bears oh my . . .) you need.

    (And you probably also should consider getting a new sysadmin to replace whomever's still got the r-services enabled on machines; but that's neither here nor there . . .)