SHELL SCRIPTING Programming, For Beginners, Learn Coding Fast! by Yao Ray
Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: Tutorial eBook & Book, A Quick Start Guide.
Published: 2020-08-03T16: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
if [ -x $file ] # check if the object is executable
then
echo "The object is executable"
else
echo "The object isn't executable"
fi
if [ -f $file ] # check if the object is a file
then
echo "The object is a file"
else
echo "The object isn't a file"
fi
if [ -d $file ] # check if the object is a directory
then
echo "The object is a directory"
else
echo "The object isn't a directory"
fi
if [ -s $file ] # check if the object isn’t empty
then
echo "The object isn't empty"
else
echo "The object is empty"
fi
if [ -e $file ] # check if the file is existing
then
echo "The file is existing"
else
echo "The file isn't existing"
fi
Download
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.
API Testing and Development with Postman by Dave Westerveld(3594)
Learning C# by Developing Games with Unity 2020 by Harrison Ferrone(2594)
Software Architecture for Busy Developers by Stéphane Eyskens(2298)
2021 Beginners Guide to Python Programming Language: A Crash Course to Mastering Python in One Hour by Elmer Gary & Elmer Gary(1884)
Machine Learning for Algorithmic Trading by Stefan Jansen(1628)
Hands-On ROS for Robotics Programming by Bernardo Ronquillo Japón(1572)
Delphi GUI Programming with FireMonkey by Andrea Magni(1456)
Game Development Projects with Unreal Engine by Hammad Fozi & Goncalo Marques & David Pereira & Devin Sherry(1400)
Cloud Native with Kubernetes by Alexander Raul(1373)
Datadog Cloud Monitoring Quick Start Guide by Thomas Kurian Theakanath(1346)
Software Architecture Patterns for Serverless Systems by John Gilbert(1337)
Practical Node-RED Programming by Taiji Hagino(1335)
Automate It with Zapier by Kelly Goss(1318)
Practical System Programming for Rust Developers by Prabhu Eshwarla(1312)
Delphi Programming Projects by William Duarte(1292)
Mastering React Test-Driven Development by Daniel Irvine(1287)
Developing Multi-Platform Apps with Visual Studio Code by Ovais Mehboob Ahmed Khan & Khusro Habib & Chris Dias(1253)
Ghidra Software Reverse Engineering for Beginners by A. P. David(1243)
Learn Spring for Android Application Development by S. M. Mohi Us Sunnat(1235)
