Re: Linux equivilent to .bat files

From: no one (allyourfriendsaremakebelieve@hotmail.com)
Date: Wed Nov 14 2001 - 00:47:29 CET


>I know they're scripts and that, but is there something special about them?
>Do they need a certain extension or something?
>How to work with the linux equivilent of .bat files?

Jarv's rustically reduced start-guide to scripting:

Basically, if you put commands in a text file then,
. mylistofcommands
will execute the list of commands

If you add the line
#!/bin/sh
as the first line of the textfile & make it executable by
chmod a+x mylistofcommands
then you can execute it simply like any other unix command (and like .bat
files), by typing the name
If you want to be able to use your script from outside the actual directory
location of it, then cp it somewhere in your path such as
/usr/local/bin
etc.

Many complex things can be done with these scripts, much more power is
present than the simple logic present in .bat files, look through mu's
scripts, read an e-book on bash/ash scripting such as
http://www.linuxdoc.org/LDP/abs/html/

The linux gazuette (sic) had a very good series of articles as introduction
to scripting, check it out at the above site.

Hope this helped,
Jarv

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:20 CET