bat file: NewBie Question

General support questions including new installations
Post Reply
kolucoms6
Posts: 63
Joined: 2008/09/20 15:05:51

bat file: NewBie Question

Post by kolucoms6 » 2009/01/25 17:22:29

In windows, we use BAT file to execute few series of command , which help us
in not writing each command manually everytime we want to execute those
commands.

In CentOS, I want to do the same thing.

Can anyone help me with this :

I want to write below comands in a bat file and run the bat file so that it runs all commands automatically ?

wget http://asterisk.hosting.lv/bin12/codec_g723-ast12-gcc4-glibc-pentium4.so
cp codec_g723-ast12-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g723.so
chmod +x /usr/lib/asterisk/modules/codec_g723.so
wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so
cp codec_g729-ast12-gcc4-glibc-pentium4.so /usr/lib/asterisk/modules/codec_g729.so
chmod +x /usr/lib/asterisk/modules/codec_g729.so

Any Help ?

User avatar
WhatsHisName
Posts: 1549
Joined: 2005/12/19 20:21:43
Location: /earth/usa/nj

Re: bat file: NewBie Question

Post by WhatsHisName » 2009/01/25 18:28:54

Not a CentOS question.

But consider googling "writing bash scripts".

marek158
Posts: 114
Joined: 2008/08/12 11:32:43

Re: bat file: NewBie Question

Post by marek158 » 2009/01/27 12:43:17

- create a new text file (use any text editor - gedit, nedit, kate, vim, ...)
- put this line at the top (no spaces at the beginning):
#!/usr/bin/env bash

- put your commands after that
- save the file and make it executable (command: chmod +x )

Here is some excellent reading for you: http://tldp.org/LDP/abs/html/

Post Reply