Linux Shell Scripting: In 8 Hours, For Beginners, Learn Coding Fast! Linux Programming Language Crash Course, A QuickStart Tutorial Book by Script Example, In Easy Steps! An Ultimate Beginner's Guide by Yao Ray

Linux Shell Scripting: In 8 Hours, For Beginners, Learn Coding Fast! Linux Programming Language Crash Course, A QuickStart Tutorial Book by Script Example, In Easy Steps! An Ultimate Beginner's Guide by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: mobi, epub
Publisher: Linux Shell Scripting bootcamp cookbook bash tutorial for linux and unix beginners book teach yourself
Published: 2019-08-28T16:00:00+00:00


-b file

If the object is a block device file, return true.

-c file

If the object is a character device file, return true.

Example 5.2

# Assume that the file “myFile . sh” does not exist, but we still check the property of this file.

#!/bin/bash

file="/root/myFile.sh"

if [ -r $file ] # check if the object is readable

then

echo "The object is readable"

else

echo "The object isn't readable"

fi

if [ -w $file ] # check if the object is writable

then

echo "The object is writable"

else

echo "The object isn't writable"

fi



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.