المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : لينكس هام كتابة برامج بلغة شيل سكريبت



seaman77
08-02-2009, 11:59 AM
ارجو المساعدة بكتابة برامج بلغة شيل سكريبت , فانا اتعلم لينوكس حديثاً...
اولا : كتابة شيل سيكربت لاظهار التالي:
1- Write a shell script (named myconfig.sh) to show various system configurations like:
• Currently logged user and his log name
• Your current shell
• Your home directory
• Your operating system name, network nodename , operating system release
• Your current path setting
• Your current working directory
• Show currently logged number of useres
• Show all available shells



2- Write a shell script (called trans.sh) that :
• Take as command-line options any number of text files
• Read in each of these files, converts all the letters to uppercase, and then stores the results in a file of the same name but with a .caps extension


3- Write a shell script that checks to see if the first command-line option is –i or –e. If it is –i, the program count the number of lines in the file specified by the second command-line option that begin with the letter i. If the first option is –e, the program count the number of lines in the file specified by the second command-line option that begins with letter e. If the first command-line option is not –i or –e, the program prints a brief error message to the screen.


4- Write a script (Named execadd.sh) that will take a single filename as an argument and adds execute permission to the file for the user, but only if the file is a regular file.
Your script must check to see that there is exactly one argument. If there are no arguments or more than one arguments, your script must produce a "usage" message that tells how to use the script. You write it this way:
echo "Usage: $0 filename"
You must check to see if the file exists; if it doesn't, give an error message. You must check to see if the file is a regular file; if not, give an appropriate message
ارجو ممن لديهم خبرة كتابة وشرح مثل هذه التمارين

ولكم جزيل الشكر

http://edu.arabsgate.com/images/misc/progress.gif