Open main menu

CDOT Wiki β

Changes

BASH Exit Status

25 bytes added, 15:39, 12 October 2008
The test Command
|<nowiki>-e</nowiki>
|File exists
|[ -e /etc/passwd]
|-
|<nowiki>-r</nowiki>
|File is readable
|[ -r /etc/hosts]
|-
|<nowiki>-w</nowiki>
|File is writable
|[ -w /tmp]
|-
|<nowiki>-x</nowiki>
|File is executable
|[ -x /usr/bin/ls]
|-
|<nowiki>-f</nowiki>
|File is a regular file
|[ -f /dev/tty]
|-
|<nowiki>-d</nowiki>
|File is a directory
|[ -d /dev/tty]
|}