I am trying to send a mail with at command, but the mail is getting delivered instantly, instead it should send the mail as per the time provided in at command. Below is the script:
#!/bin/bash
TODAY=`date +%Y%m%d`
echo 'Please enter the User-Name:'
read name
echo 'No. of days access is required - number only'
read NumberofDays
echo "Root access revoked for $name" | mailx -s "root access revoked for $name on $TODAY" xyz@example.com| at now + $NumberofDays