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. Any Advice ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/d67fb239/attachment.htm
Linux incorporates this functionality using shell scripts. You're likely using BASH as your shell, check out this link for a decent BASH scripting tutorial: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html -- Alex Robar alex.robar at gmail.com On Sun, Jan 25, 2009 at 11:34 AM, David @ULC <ucoms2001 at gmail.com> wrote:> > 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. > > Any Advice ? > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/1cc24079/attachment.htm
David @ULC wrote:> > 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. > > Any Advice ? > ------------------------------------------------------------------------ > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersThey are called shell scripts. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/ed1d7596/attachment.htm
> > 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. > > Any Advice ? > > _______________________________________________ >Start here: http://tldp.org/LDP/Bash-Beginners-Guide/html/ It's called bash scripting. You can create a file which contains a list of commands that you want the system to perform. You can even use a system called Cron to have the system execute your bash script at a specific time. http://www.linuxhelp.net/guides/cron/ To be fair, this is likely a little out of scope for an Asterisk discussion list, but you might get more help over at the Centos website http://www.centos.org/ Have fun! Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/e9d5a053/attachment.htm
In linux, there is a what is named shell script, for example bash script. It is a powerful util allowing you to do almost everything with the system. Combined with awk and sed , bash become more than powerful. google about bash doc and you'l find all you need. 2009/1/25, David @ULC <ucoms2001 at gmail.com>:> > 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. > > > Any Advice ? > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users >-- ????? ?
On Sun, Jan 25, 2009 at 10:04:23PM +0530, David @ULC wrote:> 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.Scripts. Shell scripts are basically what you can write in the shell. And they are not the limited thing windows batch files are. See e.g.: http://vertigo.hsrl.rutgers.edu/ug/shell_help.html and the book: http://www.tldp.org/LDP/abs/html/ -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
I want to write below comands in a bat file and run the shell 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 Can anyone show me : How to write the file and then with what name I have to save it and where I have to save. And Most importantly how to run it ? On Sun, Jan 25, 2009 at 10:04 PM, David @ULC <ucoms2001 at gmail.com> wrote:> > 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. > > Any Advice ? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/2e494861/attachment.htm
Sorry for Off topic question On Sun, Jan 25, 2009 at 10:04 PMorry, David @ULC <ucoms2001 at gmail.com>wrote:> > 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. > > Any Advice ? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/cce7a74c/attachment.htm
*1) What name I have to save it.Like what extension ?* 3) How I save it ? *2) How to run it to execute it ?* Should i do vi autobatch and then type and then save it ? **>* have to save.*>**>* And Most importantly how to run it ?* On Sun, Jan 25, 2009 at 10:04 PM, David @ULC <ucoms2001 at gmail.com> wrote:> > 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. > > Any Advice ? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/239a0af3/attachment.htm
learn to use google. http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_02.html 2009/1/25 David @ULC <ucoms2001 at gmail.com>> > *1) What name I have to save it.Like what extension ?* > > 3) How I save it ? > > *2) How to run it to execute it ?* > > Should i do > > > vi autobatch > > and then type and then save it ? > > > **>* have to save.*>**>* And Most importantly how to run it ?* > > > > On Sun, Jan 25, 2009 at 10:04 PM, David @ULC <ucoms2001 at gmail.com> wrote: > >> >> 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. >> >> Any Advice ? >> > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090125/ae65ebd7/attachment.htm
1. Save it as you want, I allways use .sh 2. Then chmod 755 <filename.sh> 4. to runit ./<filename> Hope it helps 2009/1/25 Geraint Lee <geraint at gmail.com>:> learn to use google. > > http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_02.html > > 2009/1/25 David @ULC <ucoms2001 at gmail.com> >> >> >> 1) What name I have to save it.Like what extension ? >> >> 3) How I save it ? >> >> 2) How to run it to execute it ? >> >> Should i do >> >> vi autobatch >> >> and then type and then save it ? >> >> > have to save. >> > >> > And Most importantly how to run it ? >> >> On Sun, Jan 25, 2009 at 10:04 PM, David @ULC <ucoms2001 at gmail.com> wrote: >>> >>> 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. >>> >>> Any Advice ? >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- http://celord.blogspot.com/