Find the answer to your Linux question:
Results 1 to 2 of 2
hi, i have 10 files which needs to be run one after the other.the run command for each file is something like this hspice -i <i/p1> -o <o/p1> hspice -i ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    12

    run the files in order

    hi,
    i have 10 files which needs to be run one after the other.the run command for each file is something like this

    hspice -i <i/p1> -o <o/p1>
    hspice -i <i/p2> -o <o/p2>
    hspice -i <i/p3> -o <o/p3>
    hspice -i <i/p4> -o <o/p4>

    i cannot run all at a time
    i need to put these commands in a file and they need to be run in order once each file is completed.can anyone help me out how this could be done?

  2. #2
    Linux Newbie sdimhoff's Avatar
    Join Date
    Jan 2007
    Posts
    191
    I hope I am understanding your question correctly. If I was doing several things but wanted one line(or file) with the bash code to do it this is how it would go.

    1.) I want to run the command "make" then I want to run "make modules_install" ONLY once the first command (make) was done:

    $ make && make moduels_install

    2.) I want to run a program then immediately run another

    $ konqueror & exit

    So I think what you want to do is add the double && to the end of each line in your code.

    Code:
    #!/bin/bash
    hspice -i <i/p1> -o <o/p1> &&
    hspice -i <i/p2> -o <o/p2> &&
    hspice -i <i/p3> -o <o/p3> &&
    hspice -i <i/p4> -o <o/p4> &&
    .... rest of file
    Try that and if it isn't what you were looking for let me know.
    Linux since: 2001
    Gentoo since: 2004
    - - - - - - - -
    Translation:
    I fix things until they break.

Posting Permissions

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