Entries Tagged as ''

Shell Programming: test operators

Shell programming can execute test command for strings, integers and files. It’s commonly used when process conditional commands by using if-then-else appraoch.

You can compare two strings to see whether they are equivalent or not. You also can test a single string to see whether it has a value or not.

String

The test command can perform comparaion for integers.

Integers

All the file test options return true only if the file exists.

File