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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use arguments in a script?

774


How does path variable work?

709


How do I run a script on mac?

763


What is echo in shell?

853


Explain about sourcing commands?

816


What are the different types of shell scripting?

751


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

817


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

729


What is the significance of the shebang line in shell scripting?

756


How to set an array in linux?

791


What is bash coding?

677


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.

1902


Which scripting language is best for automation?

706


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

2067


What is bash command used for?

767