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
How will you emulate wc –l using awk?
What does $$ mean in shell script?
What's the difference between scripting and coding?
What can scripts do?
What is shell scripting used for?
What are zombie processes?
Why is a script important?
What does debug script mean?
How do I save a powershell script?
What is in a script?
What is a program shell?
What is shell application?
What exactly is a shell?
What is the first line in a shell script?
How do I run a powershell script?