Shell script that accepts a list of file names as its arguments, counts and reports the occurrence of each word that is present in the first argument file on other argument files

Commands:tr: The tr command can be used for to translate the characters that means the given string is replaced with the replacement string.Syntax: Tr [original string] [replacement string]grep: The grep…

Continue ReadingShell script that accepts a list of file names as its arguments, counts and reports the occurrence of each word that is present in the first argument file on other argument files

Shell script that displays list of all the files in the current directory to which the user has read, write and execute permissions

Used commands: cd: The cd command can be used for to change the directory that means we can change the existing directory. echo "enter the directory name" read dir if…

Continue ReadingShell script that displays list of all the files in the current directory to which the user has read, write and execute permissions

Shell script that accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers

if [ $# -ne 3 ] then echo “check the arguments once” lastline=‟wc –l < $1‟ if [ $2 –lt $lastline –a $3 -le $lastline ] then nline=‟expr $3 -$2…

Continue ReadingShell script that accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers

Shell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory

# get filename echo -n "Enter File Name : " read fileName # make sure file exits for reading if [ ! -f $fileName ] then echo "Filename $fileName does…

Continue ReadingShell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory

Shell script that takes a command –line argument and reports on whether it is directory, a file, or something else

echo " enter file" read str if test -f $str then echo "file exists n it is an ordinary file" elif test -d $str then echo "directory file" else echo…

Continue ReadingShell script that takes a command –line argument and reports on whether it is directory, a file, or something else