Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run (and create!) a batch file in Linux 1

Status
Not open for further replies.

Ezequiel

Programmer
Apr 4, 2001
30
CA
Hi everybody!
I need to run (and, previously, create) a batch file in my Linux.

That is, I need to run a couple of programs one by one (in fact is the same program with different parameters).
How can I do it?

Thanks!
Ezequiel.
---
Ezequiel Glinsky
eze@bumeran.com
Buenos Aires, Argentina
 
Hi,

If you mean a script file (roughly equiv to M$ .bat file), you just create with an editor of your choice, save, make executable and run. Something like this (assuming your code has just been saved to a new file called myscript.sh) :

$chmod +x myscript.sh
$./myscript.sh

For the last bit (executing) you can use the full path (e.g. '/home/myusername/myscript.sh' ) or add the relevant directory to your path in your $HOME/.bash_profile file.

Rgds
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top