Shell Script ??!!1. Shell: command line interpreter of  OS2. Script: command set for controlling OS
To successfully write a shell script,    you have to do three things:
1. Write a scriptChoose an editor..
Script Example..$ sudo gedit script-nameNow start ur first script code:echo   "Your first name please:"read   fnameecho   ...
Example #2:Execute Commands inside ur Script..$ sudo gedit script-nameType Code:    date;who
2. Make it Executable !!   chmod +x ur-script-name   chmod 755 ur-script-name
3. Execute your script$ bash your-script-name$ sh your-script-name$ ./your-script-name
3. Or Put it somewhere the      shell can find it1.$ export PATH=:$PATH:ur-script-path2.Now just type ur-script-name     $...
Give your script alias name$ alias new-name="/path/to/command $@"
Finish..
Learn to Write ur first Shell script
Upcoming SlideShare
Loading in …5
×

Learn to Write ur first Shell script

2,053 views

Published on

This short tutorial learn you how to write simple shell script..
By: Nadine Shorbaji
Hanan Nimer

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,053
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Learn to Write ur first Shell script

  1. 1. Shell Script ??!!1. Shell: command line interpreter of  OS2. Script: command set for controlling OS
  2. 2. To successfully write a shell script, you have to do three things:
  3. 3. 1. Write a scriptChoose an editor..
  4. 4. Script Example..$ sudo gedit script-nameNow start ur first script code:echo "Your first name please:"read fnameecho "Hello $fname,Lets be friend!"
  5. 5. Example #2:Execute Commands inside ur Script..$ sudo gedit script-nameType Code: date;who
  6. 6. 2. Make it Executable !! chmod +x ur-script-name chmod 755 ur-script-name
  7. 7. 3. Execute your script$ bash your-script-name$ sh your-script-name$ ./your-script-name
  8. 8. 3. Or Put it somewhere the shell can find it1.$ export PATH=:$PATH:ur-script-path2.Now just type ur-script-name $ ur-scritp-name
  9. 9. Give your script alias name$ alias new-name="/path/to/command $@"
  10. 10. Finish..

×