What is "test"? How it is used in shell scripting?
Answers were Sorted based on User's Feedback
Answer / madhavi
test is used to validate an expression in shell script.
for ex:in if loop ,is used as follows
if test a > b
{
#some statements
}
fi
instead of
if [ a > b ]
{
#some statements
}
fi
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
What are the advantages of shell scripting?
How to debug the problems encountered in the shell script/program?
What is a program shell?
How will you copy a file from one machine to other?
What is shell scripting?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What is a shell script in windows?
What is the command to find out users on the system?
Write a command sequence to find the count of each word?
Is scripting and coding the same thing?
Explain about login shell?
write a shell script to check whether all the directories in the path exist has read and write permission