execute a shell script in a shell script

M

moongeegee

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.
 
S

smallpond

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.

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

--S
 
B

Ben Morrow

Quoth moongeegee said:
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\"
^^ ^^^^
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.
my_lag ";

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top