Skip to content

Commit 7dcd995

Browse files
committed
Solved linux path write
1 parent c35ba5b commit 7dcd995

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

shellPass.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,14 @@ case $MAX in
7979
;;
8080
esac
8181
esac
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
82+
_writeinfile
83+
}
84+
_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
8590
}
8691

8792
_askprint(){

0 commit comments

Comments
 (0)