parameters to command line


Results 1 to 3 of 3

Thread: parameters to command line

  1. #1
    Join Date
    Mar 2000
    Posts
    320

    parameters to command line

    Ok, I have this shell program that I need to use in my program. But I'd rather the user have the luxury of letting my program enter commands into this shell program and then exit by itself. The shell program doesn't take any parameters. I just want to execute one command and then quit. I've tried batch files, but once the program is launched, it won't execute the remaining statements until the program is exited. If anyone knows how to do this in Unix or Windows, let me know.

  2. #2
    Join Date
    Jul 1999
    Location
    Rochester, NY
    Posts
    1,513
    let me get this straight, you want to execute a program from within a script, but not wait for that program to complete before continuing? In linux you can just add a '&' after the command, which causes it to run in the background.

    For example try:
    Code:
    #!/usr/bin/sh
    date
    sleep 2 &
    date
    and compare it to:
    Code:
    #!/usr/bin/sh
    date
    sleep 2 
    date
    -kmj- keith - (G)AIM: KMJ2L

    Perl's philosophy is "There's more than one way to do it." I think that Python is one of the best ways.

    Check out codeexamples.org | coderforums.net | The Grasshopper's Journal

  3. #3
    Join Date
    Jan 2000
    Location
    Houston, TX, USA
    Posts
    9,994
    You can prepend "nohup" to it to totally detach it from any controlling terminal as well.
    We love Sensei!!
    A 1:1 ratio of Arby's sauce to Horsey sauce must be maintained.
    Like Linux? Want to like it more? Try Debian
    Best. (Python.) IRC bot. ever.
    Geekology

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •