Sziasztok
Adott a lenti ksh függvény. A here document -ben lévő ~< és ~. sorok érdekelnének. Mi ez? Hogy működik? Nem láttam még ilyet. Olvastam doksit, megtekertem a guglit is, de nem találtam róla semmit (input redirection).
Tudom, hogy a levél csatolmányát hozza létre, de maga a mechanizmussal nem találkoztam még.
mailReport()
{
if mailx -s "Error report" $SUPPORT_GROUP << EOF 2>&1 | sed -e s+'^".[^"]*"'++g -e s+"[0-9]*/[0-9]*[ ]*$"++g 2>&1
|egrep -v "(^[ ]*$|keyboard assumed)" 2>&1|tee $MAIL_LOG 2>&1|grep -c . >/dev/null 2>&1
Job encountered an error which has been attached to the mail.
Please check.
~< ! unix2dos $1|uuencode `basename $1`.txt
~.
EOF
then
echo "... failed:"
cat $MAIL_LOG
cleanUpAndExit 1
fi
}
- 1320 megtekintés
Hozzászólások
man mailx...
" ~< filename, ~< !command
Read the named file into the message. If the argument begins
with a `!', the rest of the string is taken as an arbitrary sys-
tem command and is executed, with the standard output inserted
into the message.
...
~. Simulate end-of-file on input."
- A hozzászóláshoz be kell jelentkezni
Köszi, majdnem hülyén haltam meg. ;) Azt hittem, hogy ez valami shell redirection dolog. Eszembe se jutott, hogy a mailx parancsa lesz.
Mindíg tanul az ember.
- A hozzászóláshoz be kell jelentkezni