[KLUG Members] linux scripts

Buist Justin members@kalamazoolinux.org
Thu, 15 Aug 2002 15:44:26 -0400


You are correct, the first line of a file will tell the system what should process it.

Common ones are:

#!/bin/sh (POSIX Shell... or close to it)
#!/bin/bash (Bourne Again Shell)
#!/bin/tcsh (don't use that... :) )

You're probably best of just using #!/bin/bash if you don't expect to ever bring your scripts to any other system than a Linux box.

http://www.beforever.com/bashtut.htm Might be a nice place to start learning bash scripting, but you should be able to pull up any number of them off google.com

... or you could learn perl.

Justin Buist


> -----Original Message-----
> From: bill [mailto:bill@billtron.com]
> Sent: Thursday, August 15, 2002 3:35 PM
> To: members@kalamazoolinux.org
> Subject: [KLUG Members] linux scripts
> 
> 
> In Dos/Win I could write a simple command line script with a 
> bit of programming,
> name the extension .bat and execute it whenever I want.
> 
> In Linux it appears I can do the same.  Just write command 
> lines, save as text
> and make it executable.
> 
> Now, I want to have some functionality in the code (if this, 
> do that, else,
> on_error, ...).  I'm thinking that in Linix, scripts can be 
> handled by different
> processors by using the #path_to_shell as the first line.  
> But, that's as far as
> I know.
> 
> Is my "shell" thinking correct?
> 
> What would be the best way to add simple functionality to scripts?
> 
> Where could I find info on the proper syntax for the 
> appropriate shell?
> 
> kind regards,
> 
> bill hollett
> 
> _______________________________________________
> Members mailing list
> Members@kalamazoolinux.org
> 
>