Shell script that takes a command –line argument and reports on whether it is directory, a file, or something else Post author:Educate Post published:October 6, 2023 Post category:Shell Script Post comments:0 Comments 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 "not exists" fi if test -c $str then echo "character device files" fi You Might Also Like Shell script that accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers October 6, 2023 Shell script to find gcd and lcm of given two numbers September 15, 2023 To search a pattern using grep and fgrep command September 20, 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 accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers October 6, 2023