We can use the command `test` but it is more common to test a condition implicity by using square brackets. The square brackets are an alias for `test`. We use this alias when we use `IF` logic.
When we run a test the result we get back is a return status of a `0` or a `1`. `0` indicates that the test was a success and `1` means failure. (Bear in mind this is in contrast to most all other programming languages.)
If we run a test in the command line we won't get a `0` or a `1` or back, there will just be silence from the shell. We can explicitly invoke the return value with variable `$?`, e.g:
Extended test also allows us to use regular expressions as part of our test conditions. In order to test against a regular expression we use `=~` as the comparison operator.
```bash
[[ "thomas" =~ t.* ]]; echo $?
```
Here the test succeeds because "thomas" begins with "t" followed by any other character.