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
Explain about sourcing commands?
What is path variable bash?
What are zombie processes?
How do I open a jshell in cmd?
How do I run a .sh file?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What language is bash?
What exactly is a shell?
What is the use of "$?" Sign in shell script?
What is another name for a bash shell script that you might see?
Why is used in shell scripting?
Explore about environment variables?
What is a beat in a script?
how to get part of string variable with echo command only?
What is the syntax of "nested if statement" in shell scripting?