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

Explain about sourcing commands?

1073


What is path variable bash?

1023


What are zombie processes?

1011


How do I open a jshell in cmd?

1209


How do I run a .sh file?

1000


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

977


What language is bash?

903


What exactly is a shell?

1057


What is the use of "$?" Sign in shell script?

1151


What is another name for a bash shell script that you might see?

1462


Why is used in shell scripting?

975


Explore about environment variables?

1021


What is a beat in a script?

1049


how to get part of string variable with echo command only?

1005


What is the syntax of "nested if statement" in shell scripting?

1081