1) I created a folder in /root called test
2) I ran the script so that the destination folder is /root/test
3) I trashed the folder
4) I ran the script again. I saw that the initial folder choice is /root/test
which may cause confusion. That is why I suggested that there be a
test of the existence of the destination folder
(Note that the file 'destination' holds the folder name including path)
Code: Select all
[ ! -d $WORKDIR/destination ] && echo "/root" > $WORKDIR/destination
Your script is very clever. I never thought of doing it that way however
profession programmers prefer to modify configuration files
in case a write-to-disk operation is faulty. With your script the script would be damaged
and the entire app would have to be installed again.
_____________________________________________________