script file extension/syntax

Richard Lightman richard at nezumi.plus.com
Wed Oct 23 08:09:41 PDT 2002


* Eric Miller <emiller at techskills.com> [2002-10-23 15:59]:
> 
> What is the file extension for bash scripts

No extension is required. Files are regonised by their contents, not
their names.

> can I just change the file
> extension on a .txt file to that and have it work properly?

You must make it executuable:
chmod 755 script


>  Also, what is
> the correct path to drop the script in to have it work from the command
> line, I think its /bin or /sbin.

To get a list:
echo $PATH


>  Does executing a script in linux require a
> special syntax (like @<scriptname>) or do I just type the filename if its in
> the right path?
> 
Just type the file name.
While you are learning, it would be a bad idea to execute scripts as
root. You would have to be root to put files in those directories. You
could add some directory to your path. Eg:
export PATH=$PATH:/home/richard/bash_testing

or from inside that directory, type:
./script_name


The answers to your next 50 questions are at:
http://www.linuxdoc.org/HOWTO/Bash-Prog-Intro-HOWTO.html


Richard
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list