Skip to content

Instantly share code, notes, and snippets.

@bamos
Last active August 29, 2015 14:24
Show Gist options
  • Save bamos/c8a869d8c8cd8943e013 to your computer and use it in GitHub Desktop.
Save bamos/c8a869d8c8cd8943e013 to your computer and use it in GitHub Desktop.
Missing first character when piping script into mutt with cron
# Manually running script
test1: test Tue Jul 7 09:41:01 EDT 2015
test2: test Tue Jul 7 09:41:01 EDT 2015
email: test Tue Jul 7 09:41:01 EDT 2015
# Running script in cron
Entry: * * * * * /home/bamos/tmp/test.sh
test1: test Tue Jul 7 09:41:01 EDT 2015
test2: test Tue Jul 7 09:41:01 EDT 2015
email: est Tue Jul 7 09:41:01 EDT 2015
# Running script in cron with all of my shell's `env` at the beginning
Entry: * * * * * /home/bamos/tmp/test.sh
test1: test Tue Jul 7 09:41:01 EDT 2015
test2: test Tue Jul 7 09:41:01 EDT 2015
email: est Tue Jul 7 09:41:01 EDT 2015
#!/bin/bash
echo "test $(date)" | mutt brandon.amos.cs@gmail.com -s "test"
echo "test $(date)" > /tmp/test1
echo "test $(date)" | cat > /tmp/test2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment