- Take a directory name and a file name. Create the directory and then create the file inside.
- Take a user name and print all processes from that user
- Write a shell script that reads a file name from the user, prints its contents and the number of lines in the file.
- Write a shell script that asks the user for a number, if the user chooses 7 - print "You Win".
- Write a shell script that takes two file names, and prints the contents of the larger one.
- Write a shell script that reads a file name from the user, checks that the file is valid, and lowecases its name. For example, running
lc MyFile
should rename the fileMyFile
tomyfile
(Hint: use tr).
-
Write a shell script that takes a file name and prints the file double spaced
-
Write a shell script that takes a file name and prints only even lines
-
The command "unzip" extracts contents of a zip file. Write a shell script that unzips all zip files in a directory
-
write a shell script that takes several file names as inputs, and copies itself to each of the files. Also change permissions of target files to executables.
-
Write a shell script that counts the number of files in each directory and print each directory name and its file count Sample output:
dir = ., files = 12 dir = ./a b, files = 0 dir = ./bar, files = 0 dir = ./foo, files = 2