execute a shell script in a shell script

execute a shell script in a shell script

am 03.12.2007 14:30:57 von 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.

Re: execute a shell script in a shell script

am 03.12.2007 22:10:08 von smallpond

On Dec 3, 8:30 am, moongeegee wrote:
> 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

Re: execute a shell script in a shell script

am 04.12.2007 01:18:13 von Ben Morrow

Quoth 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\"
^^ ^^^^
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