I am having simple ruby script which will send mail after certain time, this is my code :
#!/usr/bin/env ruby
system("at now + 1 day <<END
echo 'This is test message from xyz' | mail -s 'Test message' [email protected]
END")
whenever I run this script, I get
sh: END: not found
Edit 1
If I use on single line like
system("at now + 1 min echo 'This is test message from xyz' | mail -s 'Test message' [email protected]")
it gives error :
syntax error. Last token seen: e
Garbled time
what am doing wrong in this ?
ENDcommand/template do?system, If I am doing wrong than what would be the correct syntax for sending mail. ?syntax error. Last token seen: eThis command does not work when run from the terminal. You get the same error.