I am trying to create a program that takes a single argument, a file, and then checks what happened to the file after 60 seconds. To do this, I need to save the result from -e $1in a variable, and then check it after 60 seconds. I can't seem to get the expression ifto listen to me, and I know this is wrong. For testing purposes, this script immediately displays the result of the comparison. Looking forward to a working example of this, I do not know how many versions I have made from this tiny program. Thank you Tomorrow, any help is much appreciated!
#!/bin/bash
onStartup=$(test -e $1)
if [ -e "$1" ]; then
unixtid1=$(date +"%s" -r "$1")
echo $unixtid1
fi
sleep 3
if [[ $onStartup=1 ]]; then
echo "Exists"
fi
if [[ $onStartup=0 ]]; then
echo "Does not exists"
fi
source
share