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?

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


Please Help Members By Posting Answers For Below Questions

How to check if a directory exists?

1199


What is bash eval?

1017


What is difference between shell and bash scripting?

990


What is gui scripting?

1110


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2475


What does sh mean?

1056


What is a shell in operating system?

1103


What is a shell script in windows?

1092


What is @echo off?

1021


What is a shell made of?

962


How does shell scripting work?

1115


Write a script to print the first 10 elements of fibonacci series.

2349


What are zombie processes?

1030


How to get script name inside a script?

1012


How do I run a shell script on a mac?

1126