June 2017
Beginner
502 pages
11h 26m
English
The exclamation mark is a keyword that negates or reverses a test or an exit status. For instance, take a look at this:
zarrelli:~$ ls -lah test.colon.2 ; echo $?-rw-r--r-- 1 zarrelli zarrelli 10 Feb 19 14:22 test.colon.20
The exit code of ls is 0, true, since it was successful. But let's reverse it:
zarrelli:~$ ! ls -lah test.colon.2 ; echo $?-rw-r--r-- 1 zarrelli zarrelli 10 Feb 19 14:22 test.colon.21
Read now
Unlock full access