السلام عليكم

هلا أخوانى ياريت لو حد يصمم لى هذه الأسكربتات او شئ منها


الأول:

A script can have zero or many arguments. Here is an example of a script that receives two
arguments and displays them. You can try it if you wish.
echo $1
echo $2
Now, write a shell script that outputs the number of lines in the file passed as the first argument.


الثاني:

Write a shell script which renames all .txt files to .text files in your current directory. Make sure
you create few files with extension .txt in your user directory to test your script.
Hint: Inside your script, use the basename command to extract the file extens ion.
basename file_name.txt .txt
should produce:
file_name


الثالث:

Write a shell script that receives 2 file names as arguments and displays if they are similar or not.
Hint: Use the cmp command which takes two files as arguments and compares them. As you will
see, the cmp command either returns the first string where they differ or returns nothing. Your
script is like a new version of cmp.


الرابع:

Write a shell script that does the following tasks (the result should be in a file called “journal”):
1. Prints the current date.
2. Prints the list of users currently logged on.
3. Prints the list of processes currently running under your shell.
4. Makes the journal file world accessible for reading and writing only (i.e. accessible by the 3
groups).
Hint: Use the redirection (> for redirecting and >> redirecting and appending)
: Note
Assignment 4 should be submitted as a hard copy at the beginning of the class of Saturday,
December the 25th. Please don’t forget to write your name, user ID and section number on the
assignment sheet.


أدرى وايد لكن شو انسوي طلبات الدكاتره ماتخلص مايشرحون لنا الدروس ويبونا نصمم

ياريت ألقي مساعدتكم في الموضوع