execute a shell script in a shell script

execute a shell script in a shell script

Post by moongeege » Tue, 04 Dec 2007 22:30:57


Please help.
I have been stumbled on this issue, please see below. I am unable to
execute a shell script in a shell script.
I need to use perl script but not others and have tried eval, -exec
and other on perl script but failed.
system"cleartool setview -exec \"cleartool describe -fmt 'On %Sd
modified %En and comment:\n %c\n\n' /myproject/vob/myprogram.C\"
my_lag ";

tks.
 
 
 

execute a shell script in a shell script

Post by smallpon » Wed, 05 Dec 2007 06:10:08


Must be a clearcase problem. This works fine:
perl -e 'system "perl -e \"system \"ls\"\""'

--S

 
 
 

execute a shell script in a shell script

Post by Ben Morro » Wed, 05 Dec 2007 09:18:13


Quoth moongeegee < XXXX@XXXXX.COM >:
^^ ^^^^
Note that these will be translated by Perl into literal newline
characters before the shell sees them; I don't know if this might be
causing problems.


You may have better luck with system LIST and single quotes, as you've
two fewer layers of interpolation:

(my $ctcmd = <<'CTCMD') =~ tr/\n//d;
cleartool describe -fmt 'On %Sd modified %En and comment:\n %c\n\n'
/myproject/vob/myprogram.C
CTCMD

system
cleartool => setview =>
-exec => $ctcmd,
'my_lag';

Ben