On Wed, Jul 21, 2010 at 1:17 PM, newbie01 perl <newbie01.p...@gmail.com> wrote:
> Does $_ contains the following values on each iteration?
>
> mail_smtp.pl
> -r
> ${MAILFROM}
> -s
> "$subject_line TEST EMAIL"
> supportm...@test.com
> <
> /tmp/test_email.txt

Just to clarify the end of the command line:

mail_smtp.pl -r ${MAILFROM} \
        -s "$subject_line TEST EMAIL" \
       supportm...@test.com < /tmp/test_email.txt

The '< /tmp/test_email.txt' part is not extra arguments passed to the
script. That is a file redirection operator in the shell[1], used to
write the file to the script's standard input stream. The script
accepts an option -f to specify the file to retrieve the message data
from, but if none is specified then it defaults to - which is
basically an alias for STDIN.[2]

The same thing can be accomplished with a pipe:

cat /tmp/test_email.txt | mail_smtp.pl -r ${MAILFROM} \
        -s "$subject_line TEST EMAIL" supportm...@test.com

So the script wouldn't see arguments equal to '<' or
'/tmp/test_email.txt'. The shell will handle those for it automatically.


[1] http://en.wikipedia.org/wiki/Redirection_(computing)
[2] perldoc -f open

-- 
Brandon McCaig <bamcc...@gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org>

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to