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

c program to display the information of given file similar to givan by the unix or linux command ls -l

2210


What is a shell made of?

946


How do I run a shell script on a mac?

1117


Which shell is the best?

986


What is gui scripting?

1094


How many fields are present in a crontab file and what does each field specify?

1110


How do I open the shell in cmd?

1126


What is a shell environment?

991


What are "c" and "b" permission fields of a file?

1020


How are shells born?

960


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

2201


Is bash a shell script?

1055


Is shell scripting useful?

1043


What does $$ mean in shell script?

1049


When should shell programming/scripting not be used?

1143