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 advantages of shell scripting?

0 Answers  


How to debug the problems encountered in the shell script/program?

0 Answers  


What is a program shell?

0 Answers  


How will you copy a file from one machine to other?

0 Answers  


What is shell scripting?

0 Answers  


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

0 Answers  


What is a shell script in windows?

0 Answers  


What is the command to find out users on the system?

0 Answers  


Write a command sequence to find the count of each word?

0 Answers  


Is scripting and coding the same thing?

0 Answers  


Explain about login shell?

0 Answers  


write a shell script to check whether all the directories in the path exist has read and write permission

1 Answers  


Categories