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 |
HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?
Explore about environment variables?
i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..
What is wc in shell script?
How do I run a shell script in powershell?
What is the difference between a shell variable that is exported and the one that is not exported?
Is powershell a language?
How do you find out What is your shell?
What is meant by $1 in shell script?
What is shell environment?
State the advantages of shell scripting?
What is awk script?