ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As mentioned by others, to preserve formatting place your code snippets inside [CODE]...[/CODE] tags. You may type those yourself or click the "#" button in the edit controls.
When asking for help troubleshooting your code it is always helpful to post a minimal working example of code which produces an error or incorrect result, along with the actual error message it produces. Only you are sitting at the keyboard and can interact with it, we can only base advice on what you tell us.
Is there any limit how many boolean operatores can be used ?
Here i have used two times ,Can i use it more times as well in unix ???
You can chain as many booleans as necessary to express the desired condition.
It would be helpful to others if you would respond to the questions already asked. LQ members are happy to help you solve problems, but doing so requires two-way communication and respect for the time they volunteer to provide that help.
Last edited by astrogeek; 10-08-2018 at 03:41 PM.
Reason: Added quote to remove ambiguity
if [[ condition ]] && [[ condition ]] && [[ condition ]] ;
then
echo "yeppers"
else
echo "noppers"
fi
The op never mentioned that bash is being used so its worth pointing out that [[ condition ]] with the double brackets is not portable. Additionally its not required in this context.
The above is fully portable, shells that it will work in include true bourne shells (i.e. hsh), ash, dash, bash, ksh, loksh, mksh, pdksh, posh, yash and zsh.
The above is fully portable, shells that it will work in include true bourne shells (i.e. hsh), ash, dash, bash, ksh, loksh, mksh, pdksh, posh, yash and zsh.
not arguing about the portability part, just expressing my knowledge of bash and bash and bash. cheers@!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.