I just want to write a little shell script, which restarts my dosbox everytime it crashes.
#!/bin/bash
while [ "1" == "1" ]
do
test=$(pgrep dosbox)
if [ "$test" == '' ]
then
date + "%d-%m-%y %T" >> autostartLog.txt
dosbox emulator
fi
done
and it restarts fine, but I can't write into my autostartLogs.txt.
I tried
echo $(date + "%d-%m-%y %T) >> autostartLog.txt
in the terminal and it worked perfectly, but if I use it in my script it doesn't do anything.
edit: used checker, but it still doesn't write.