The task sounds non-sense to me.
Running a process in background means:
the stell starts that command as background process (fire and forget) and immediately continues with the next command.
I.e. this completes instantly:
sleep 100 &
echo "done"
You may observe the
sleep
process by running the
ps
command.
Cheers
Andi
PS: In your case, the "in background" is non-sense. Leave away the
&
.
PPS: If you want the sleep and the echo go into one background process, do this:
read -p "Enter seconds: " sec; (sleep $sec; echo "have a nice day") &
.