[wplug] Linux BAT Files

harrold at sage.che.pitt.edu harrold at sage.che.pitt.edu
Thu Mar 22 08:40:20 EST 2001


On Thu, 22 Mar 2001, Dr. SDM (Linux) wrote:

> Yes they are the same as dos bat files......
> 
> Thanks
> Dr. SDM
> 
> ...Does anyone have any information on how to make linux BAT Files
>  
> any information is greatly appreciated

in unix these are referred to as shell scripts.

so you essentially do the same thing you do in dos. you put a series of
commands in a text file. you can name it blah.bat if you want but the
extension isn't relivant. after you make the text file you chmod it
$chmod +x file.sh 
this makes it so you can execute the file.
then to execute you type
$./file.sh
unless the shell script is located in your path. then you just type
$file.sh

you can use different shells when executing your script. this is done by
indicateing which shell you want to use in the first line of the
program. the first line should look like this 
#!/path/to/shell
if you want to use an alternate shell. (bash is probably what you are
useing by default). so to use perl you can put
#!/usr/bin/perl (at least that is where it is on my computer)
as the first line in your script.

let me know if you need clarification on anything. this is pretty
breif. you can also try manning the bash shell.

--
john




More information about the wplug mailing list