Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
d=$(dirname $0)
$0 here is a variable that indicates the path to the file of the running script from the place where this script was launched from.
The variable d will be assigned (=) the path to the directory of the script being run, here dirname will cut off the ending.
You can surprise it by adding variable output
echo "0 = $0"
echo "d = $d"
DIR=$(dirname $(readlink -e "$0"))
echo "DIR = $DIR"
if [ -f "/etc/license" ]; then
echo "The panel is already installed."
exit
fi
-f file - True if file exists and is a regular file.
So yes, -f means file (./$NAME.tar in your case) exists and is a regular file (not a device file or a directory for example).
If the "/etc/license" file exists and does not represent a device or folder
Print "The panel is already installed."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question