Answer Posted / satchi
"Test" command checks file and directory types and checks
value.
EX: create a empty file test (touch test)
if test -f test
then
echo "File is nonempty"
else
echo "file is empty"
fi
There are different options like -d -b -e.You can explore
all.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the advantages of using shell scripts?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
What is shell variable?
What is bash command used for?
What is difference between bash and shell?
What is sh in shell script?
Can shell script run on windows?
Print the 10th line without using tail and head command.
State the advantages of shell scripting?
What is k shell?
Differentiate between ‘ and ” quotes.
What is the use of "$#" in shell scripting?
What is the default ubuntu terminal?
What happens when you type ls?
How to print all the arguments provided to the script?