Answer Posted / swaroopa
The test command is particularly useful in this context
allowing a variety of conditions to be checked for. There
are two equivalent syntaxes.
test expression
and
[ expression ]
The following simple example will list all the
subdirectories of the current directory.
for i in *
do
if [ -d $i ]
then
echo $i
fi
done
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are the disadvantages of shell scripting?
Is powershell a bash?
What is the use of .sh file?
Calculate a real number calculation directly from the terminal and not any shell script.
How to print the first array element?
is this growing field and what is average package in this?
What is a shell in operating system?
Write down the syntax for all the loops in shell scripting.
Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
What does $@ mean bash?
What is the lifespan of a variable inside a shell script?
how will you find the total disk space used by a specific user?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What is mac default shell?
What is the difference between grep and egrep?