Shell script that accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers Post author:Educate Post published:October 6, 2023 Post category:Shell Script Post comments:0 Comments 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 + 1‟ echo “‟tail +$2 $1 | head -$nline‟” else echo “invalid range specification” fi fi You Might Also Like Shell script that determines the period for which a specified user is working on the system October 6, 2023 A shell program check file permissions and output the same July 29, 2023 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 October 12, 2023 Leave a Reply Cancel replyCommentEnter your name or username to comment Enter your email address to comment Enter your website URL (optional) Save my name, email, and website in this browser for the next time I comment.
Shell script that determines the period for which a specified user is working on the system October 6, 2023
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 October 12, 2023