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 does debug script mean?
What is a scripting language simple definition?
Is shell scripting a programming language?
What does echo $0 do?
Write a command sequence to find the count of each word?
How to print the first array element?
What is scripting used for?
What are the advantages of using shell scripts?
What are the different types of shell scripting?
Write a script to print the first 10 elements of fibonacci series.
What is difference between shell and bash scripting?
Can you write a script to portray how set –x works?
Explain about the slow execution speed of shells?
What is subshell?
What is the equivalent of a file shortcut that we have a window on a linux system?