faqts : Computers : Operating Systems : Linux : Shell Commands

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

59 of 73 people (81%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Operating system: Linux: File: Batch: Run: How to run a batch file in Linux?

Nov 22nd, 2003 09:24
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 22 November 2003 - 0:623 pm -------------------

Operating system: Linux: File: Batch: Run: How to run a batch file in 
Linux?

---

 sh <your batchfilename>

or also

 sh < <your batchfilename>

---

e.g.

 sh ddd

or also:

 sh < ddd

is similar to running ddd.bat in MSDOS

---

You can also inform the system that it is a batch file, by change the
executable bit, using the chmod command:

 chmod 755 <your filename>

e.g.

 chmod 755 ddd

if you the type

 ddd

on the command line, it will execute the commands in this file

---

Put the file in a 'bin' directory (e.g. in /usr/<myloginname>/bin, or
/bin).
But then the file will only be recognized as executable, when you have
logged out (this because the checking of the involved tables is only
done at login time).

---

[book: source: Brown, P. J. - begin met Unix - ISBN: 90-6789-026-X - 
p. 99]

----------------------------------------------------------------------