Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
commands:classictest [2014/10/06 04:05]
thebonsai [Misc syntax]
commands:classictest [2015/07/30 21:01] (current)
fgrose [Table] hard link is only one example. Bind mounts are another
Line 68: Line 68:
 This section probably holds the most tests, I'll list them in some logical order. Since Bash 4.1, all tests related to permissions respect ACLs, if the underlying filesystem/​OS supports them. This section probably holds the most tests, I'll list them in some logical order. Since Bash 4.1, all tests related to permissions respect ACLs, if the underlying filesystem/​OS supports them.
  
-^Operator syntax^Description^ +^ Operator syntax ​         ^ Description ​                                                                                  |   | 
-|**-a** <​FILE>​|True if <​FILE>​ exists. :!: (not recommended,​ may collide with ''​-a''​ for ''​AND'',​ see below)| +| **-a** <​FILE> ​           | True if <​FILE>​ exists. :!: (not recommended,​ may collide with ''​-a''​ for ''​AND'',​ see below) ​ ​| ​  
-|**-e** <​FILE>​|True if <​FILE>​ exists.| +| **-e** <​FILE> ​           | True if <​FILE>​ exists. ​                                                                       ​| ​  
-|**-f** <​FILE>​|True,​ if <​FILE>​ exists and is a **regular** file.| +| **-f** <​FILE> ​           | True, if <​FILE>​ exists and is a **regular** file.                                             |   
-|**-d** <​FILE>​|True,​ if <​FILE>​ exists and is a **directory**.|| +| **-d** <​FILE> ​           | True, if <​FILE>​ exists and is a **directory**. ​                                                  ​|| 
-|**-c** <​FILE>​|True,​ if <​FILE>​ exists and is a **character special** file.| +| **-c** <​FILE> ​           | True, if <​FILE>​ exists and is a **character special** file.                                   |   
-|**-b** <​FILE>​|True,​ if <​FILE>​ exists and is a **block special** file.| +| **-b** <​FILE> ​           | True, if <​FILE>​ exists and is a **block special** file.                                       |   
-|**-p** <​FILE>​|True,​ if <​FILE>​ exists and is a **named pipe** (FIFO).| +| **-p** <​FILE> ​           | True, if <​FILE>​ exists and is a **named pipe** (FIFO). ​                                       ​| ​  
-|**-S** <​FILE>​|True,​ if <​FILE>​ exists and is a **socket** file.| +| **-S** <​FILE> ​           | True, if <​FILE>​ exists and is a **socket** file.                                              ​| ​  
-|**-L** <​FILE>​|True,​ if <​FILE>​ exists and is a **symbolic link**.| +| **-L** <​FILE> ​           | True, if <​FILE>​ exists and is a **symbolic link**. ​                                           ​| ​  
-|**-h** <​FILE>​|True,​ if <​FILE>​ exists and is a **symbolic link**.| +| **-h** <​FILE> ​           | True, if <​FILE>​ exists and is a **symbolic link**. ​                                           ​| ​  
-|**-g** <​FILE>​|True,​ if <​FILE>​ exists and has **sgid bit** set.| +| **-g** <​FILE> ​           | True, if <​FILE>​ exists and has **sgid bit** set.                                              ​| ​  
-|**-u** <​FILE>​|True,​ if <​FILE>​ exists and has **suid bit** set.| +| **-u** <​FILE> ​           | True, if <​FILE>​ exists and has **suid bit** set.                                              ​| ​  
-|**-r** <​FILE>​|True,​ if <​FILE>​ exists and is **readable**.| +| **-r** <​FILE> ​           | True, if <​FILE>​ exists and is **readable**. ​                                                  |   
-|**-w** <​FILE>​|True,​ if <​FILE>​ exists and is **writable**.| +| **-w** <​FILE> ​           | True, if <​FILE>​ exists and is **writable**. ​                                                  |   
-|**-x** <​FILE>​|True,​ if <​FILE>​ exists and is **executable**.| +| **-x** <​FILE> ​           | True, if <​FILE>​ exists and is **executable**. ​                                                |   
-|**-s** <​FILE>​|True,​ if <​FILE>​ exists and has size bigger than 0 (**not empty**).| +| **-s** <​FILE> ​           | True, if <​FILE>​ exists and has size bigger than 0 (**not empty**). ​                           ​| ​  
-|**-t** <​fd>​|True,​ if file descriptor <fd> is open and refers to a terminal.| +| **-t** <​fd> ​             | True, if file descriptor <fd> is open and refers to a terminal. ​                              |   
-|<​FILE1>​ **-nt** <​FILE2>​|True,​ if <​FILE1>​ is **newer than** <​FILE2>​ (mtime). :!:| +| <​FILE1>​ **-nt** <​FILE2> ​ | True, if <​FILE1>​ is **newer than** <​FILE2>​ (mtime). :!:                                       |   
-|<​FILE1>​ **-ot** <​FILE2>​|True,​ if <​FILE1>​ is **older than** <​FILE2>​ (mtime). :!:| +| <​FILE1>​ **-ot** <​FILE2> ​ | True, if <​FILE1>​ is **older than** <​FILE2>​ (mtime). :!:                                       |   
-|<​FILE1>​ **-ef** <​FILE2>​|True,​ if <​FILE1> ​is a **hardlink** to <​FILE2>​. :!:|+| <​FILE1>​ **-ef** <​FILE2> ​ | True, if <​FILE1> ​and <​FILE2>​ refer to the **same device and inode numbers**. :!:              ​| ​  |
  
  
  • commands/classictest.1412568339.txt
  • Last modified: 2014/10/06 04:05
  • by thebonsai