Find the answer to your Linux question:
Results 1 to 5 of 5
I have a 2 bash scripts script_a & script_b how do i make the script_b to run from script_a I here is my example of script_a Code: #!/bin/bash pkill process ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3

    run a script from another script

    I have a 2 bash scripts script_a & script_b

    how do i make the script_b to run from script_a

    I here is my example of script_a

    Code:
    #!/bin/bash
    pkill process
    /home/user/script_b
    but this thing doesnt work. Any suggestions regarding this?

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    2 suggestions
    1. pkill process &
    2. make sure script_b is executable--can you run it yourself?
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3
    yes the script_b is executable and it works fine when I run it.
    what is the use of having '&' at the end of pkill process?

    when I run the script_a the process is being killed and I get a message 'terminated' but the script_b doesnt run.

    Is is because '&' is missing along with 'pkill process'

  4. #4
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    the ampersand '&' tells the shell to run the process
    in the background, and return immediately to whatever
    comes next.

    what is script_b?
    the sun is new every day (heraclitus)

  5. #5
    Just Joined!
    Join Date
    Feb 2010
    Posts
    1
    Hi Dude,

    pkill process

    May I know what is the process ??
    suggestion; may be you can run the script_b first and then you can call pkill ..
    I guess process could be your script_a (if not plz ignore)

Posting Permissions

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