Why the time left variable does not work properly?
#!/bin/bash
echo "time start? (format, e.g., today 16:00)"
read $timestart
timeleft=$(echo $(( $(date +%s -d "$timestart") - $( date +%s ) )))
long-command & sleep $timeleft; script.sh
Why the time left variable does not work properly?
#!/bin/bash
echo "time start? (format, e.g., today 16:00)"
read $timestart
timeleft=$(echo $(( $(date +%s -d "$timestart") - $( date +%s ) )))
long-command & sleep $timeleft; script.sh