execute a shell script in a shell script

Discussion in 'Perl Misc' started by moongeegee, Dec 3, 2007.

  1. moongeegee

    moongeegee Guest

    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.
    moongeegee, Dec 3, 2007
    #1
    1. Advertising

  2. moongeegee

    smallpond Guest

    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
    smallpond, Dec 3, 2007
    #2
    1. Advertising

  3. moongeegee

    Ben Morrow Guest

    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
    Ben Morrow, Dec 4, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johan
    Replies:
    29
    Views:
    23,022
    kaeli
    Feb 23, 2004
  2. =?ISO-8859-1?Q?Peter_H=F6ltschi?=

    execute shell script from a java app

    =?ISO-8859-1?Q?Peter_H=F6ltschi?=, Dec 3, 2004, in forum: Java
    Replies:
    2
    Views:
    15,300
    Alex Kizub
    Dec 4, 2004
  3. spec
    Replies:
    7
    Views:
    74,959
    Cameron Laird
    Jul 18, 2006
  4. Matt
    Replies:
    3
    Views:
    3,289
    Lawrence D'Oliveiro
    Nov 7, 2010
  5. kderaedt

    Execute shell script from a perl script

    kderaedt, Jun 26, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    162
    Andres Monroy-Hernandez
    Jun 26, 2003
Loading...

Share This Page