f



execute a shell script in a shell script

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.

0
moongeegee
12/3/2007 1:30:57 PM
comp.lang.perl.misc 33233 articles. 1 followers. brian (1246) is leader. Post Follow

2 Replies
1094 Views

Similar Articles

[PageSpeed] 54

On Dec 3, 8:30 am, moongeegee <moongee...@gmail.com> 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
0
smallpond
12/3/2007 9:10:08 PM
Quoth moongeegee <moongeegee@gmail.com>:
> 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

0
Ben
12/4/2007 12:18:13 AM
Reply: