Hi,
Is it possible for me to include the results from a command in the subject line? What I am looking to do is get the file count and include it into the subject line as well as the list of files in the body.
Example Subject line: Currently 25 files in directory
My Code:
#!/bin/ksh
cd /opt/app/mydirectory
ls -otrg|awk '{print $4 " " $5 " "$6 " "$7}' | /usr/bin/mailx -s "Currently #want to run ls -l | wc -l here# files in directory" email@email
I am a little new to scripting so I appreciate the help.
I can successfully email me the list of files out, formatted how I need, but would like to include the file count in the subject of the email.
Running on solaris 10.
Thanks,
Ozifer