We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c35ba5b commit 7dcd995Copy full SHA for 7dcd995
1 file changed
shellPass.sh
@@ -79,9 +79,14 @@ case $MAX in
79
;;
80
esac
81
82
-# write in file
83
-SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
84
-echo "$(date '+%d/%m/%y %H:%M:%S') - $PASS" >> $SCRIPTDIR/history.log &> /dev/null
+_writeinfile
+}
+_writeinfile(){
85
+ # write in file
86
+SCRIPT_PATH="${BASH_SOURCE:-$0}"
87
+ABS_SCRIPT_PATH="$(realpath "${SCRIPT_PATH}")"
88
+ABS_DIRECTORY="$(dirname "${ABS_SCRIPT_PATH}")"
89
+echo "$(date '+%d/%m/%y %H:%M:%S') - $PASS" >> $ABS_DIRECTORY/history.log
90
}
91
92
_askprint(){
0 commit comments