Hacker News new | past | comments | ask | show | jobs | submit login

>All of test(1) as you can use them in any if statement (/usr/bin/[ is a real command!):

Yes, and not only in an if statement. You can also use test or [ command in commands of the form:

test condition && commmand2

or

test condition || command2

which will only work if the condition is true or false, respectively (IIRC, need to check this).




That is correct, no need to check on this. I've done this for years :)


Thanks. Well, I was nearly 100% sure too (been using Unix for years too (from before Linux was created)), but "nearly" is not 100% (since I don't use that feature often), and don't like to make claims I am not sure about without a disclaimer, hence I made one :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: