Newbie question

Discussion in 'Perl' started by john D, Aug 29, 2003.

  1. john D

    john D Guest

    Hi

    I would like to make a perl script which will start another
    program and define the ouput filename as a comandline prompt.

    This means that it should execute the following:

    Program_name [outputname]

    where outputname are a combination of the present date and time.

    Can anyone tell me how I should do this.

    Sorry for the very simple newbie question-
    john D, Aug 29, 2003
    #1
    1. Advertising

  2. john D

    Ga Mu Guest

    john D wrote:
    > Hi
    >
    > I would like to make a perl script which will start another
    > program and define the ouput filename as a comandline prompt.
    >
    > This means that it should execute the following:
    >
    > Program_name [outputname]
    >
    > where outputname are a combination of the present date and time.
    >
    > Can anyone tell me how I should do this.
    >
    > Sorry for the very simple newbie question-



    my $prog = '/path/to/program';
    my $arg1 = 'first arg to pass to prog';
    system( $prog, $arg1 );
    my $status = $? >> 8;

    Look at 'perldoc -f system'.

    Greg
    Ga Mu, Aug 30, 2003
    #2
    1. Advertising

  3. john D

    Stan Mooney Guest

    maybe that and
    $arg1=`date`;
    system($prog, "$arg1");
    is what youre after?

    Ga Mu wrote:
    >
    > john D wrote:
    > > Hi
    > >
    > > I would like to make a perl script which will start another
    > > program and define the ouput filename as a comandline prompt.
    > >
    > > This means that it should execute the following:
    > >
    > > Program_name [outputname]
    > >
    > > where outputname are a combination of the present date and time.
    > >
    > > Can anyone tell me how I should do this.
    > >
    > > Sorry for the very simple newbie question-

    >
    > my $prog = '/path/to/program';
    > my $arg1 = 'first arg to pass to prog';
    > system( $prog, $arg1 );
    > my $status = $? >> 8;
    >
    > Look at 'perldoc -f system'.
    >
    > Greg
    Stan Mooney, Aug 31, 2003
    #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. Jerry C.
    Replies:
    8
    Views:
    214
    Uri Guttman
    Nov 23, 2003
  2. Kruno Saho
    Replies:
    0
    Views:
    131
    Kruno Saho
    Apr 7, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    113
    Dave Angel
    Apr 7, 2013
  4. rusi
    Replies:
    0
    Views:
    102
  5. Miki Tebeka
    Replies:
    0
    Views:
    76
    Miki Tebeka
    Apr 7, 2013
Loading...

Share This Page