Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is "test"? How it is used in shell scripting?

Answers were Sorted based on User's Feedback



What is "test"? How it is used in shell scripting?..

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

What is "test"? How it is used in shell scripting?..

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

Post New Answer

More Shell Script Interview Questions

What are the different variables present in linux shell?

0 Answers  


How do I stop script errors?

0 Answers  


What is the best scripting language?

0 Answers  


write a shell script to check the failed jobs?

0 Answers   Wells Fargo,


Write a shell script to check whether a number is Armstrong number or not?

1 Answers   Flipkart,


What are the various stages of a linux process it passes through?

0 Answers  


What is c in shell script?

0 Answers  


How to handle the delimiter unit seperator in Unix

2 Answers  


What is bash command used for?

0 Answers  


Why we are writting shell scripts? Plz if possible explain it briefly.

6 Answers   ITC Infotech,


What are the different shells available?

3 Answers  


How to redirect both standard output and standard error to the same location?

0 Answers  


Categories