Linux in General > Linux Development & Programming
shell script
(1/1)
puneetloiya:
hi all,
as i m very new to Linux . plz tell me how to run shell script in Linux
bye
Puneet
dragoncity99:
To run it, simply type
"./"" and followed by the script name without spaces after "/"
Make sure u r in that scripts directory too.
i.e. For a script called "myScript" which is located in /home/richard directory, type:
----> cd /home/richard
----> ./myScript
OR u can do so by typing the command :
----> /home/richard/myScript
puneetloiya:
Hello Dragoncity,
i didn't get u . plz tell me in details vth one example.
thnx
Puneet
dragoncity99:
1. Create a new script called "abc" in /home directory and type the following text:
/sbin/ifconfig
2. Save and exit.
3. Now open go to the current home directory using a terminal/console ----> text mode, go to the home directory.
4. Type:
chmod 770 abc
5. now "abc" will be an executable script which will display the ip address of ur network card let's say eth0.
6. run the script u have just created by typing:
./abc
Done
Navigation
[0] Message Index
Go to full version