Unix Tutorial 17 : Advance Unix
Unix includes commands for: Testing various conditions associated with specified files. Testing various conditions associated with specified strings. Performing file read/write operations. Arrays Arrays are used to store a series of values in an indexed list. Items in an array are stored and retrieved using an index. Note that Arrays are not supported by the original Bourne Shell, but are supported by bash and other newer shells. File Test Operators Shell scripts often need to check various properties of files as a part of the control flow. Unix provides a number of options for this purpose. File existence checks: -f file True if the file exists and is an ordinary file. -d file True if the file exists and is a directory. -s file True if the file exists and is not empty. -c file True if the file exists and is a character device file. -b file True if the file exists and is a block devise file. File access checks: -r file True if the file exists and has read perm...