I am trying to go into a file that has already been set up as a variable, $FTPDB_FILE. Once in the file, I need to grep for the 8th field of each of the files listed. Once I grep that 8th field, the results can be three different things: ndm, ssl, or a no/yes which means the file was sent via ftp. I need to then say that if the result of the grep is not ndm or ssl, that the result means the file was ftp'd. Then I need to say otherwise the file was either ndm or ssl(depending on what the file specifically listed.) At that point I need to send the results of the grep to the subject line of an e-mail. so far this is what I have:
determine_connection_type()
{
grep $FTPDB_FILE | cut -d ";" -f1,8| uniq -c
if [ $RESULT -ne `NDM` or `SSL` ]
then
$RESULT = `FTP`
else ???????
Another part of my script lists the e-mail function:
send_email()
{
echo "`date` \nCannot send files via $RESULT to ABC from `hostname`.
One other dilemma. The file represented by the variable $FTPDB_FILE, has about 9 of the first lines commented out so I would need to ignore any of the lines beginning with a ###.
Thank you in advance to anyone who is willing to help me out with this problem.
Thanks,
ryanildo
determine_connection_type()
{
grep $FTPDB_FILE | cut -d ";" -f1,8| uniq -c
if [ $RESULT -ne `NDM` or `SSL` ]
then
$RESULT = `FTP`
else ???????
Another part of my script lists the e-mail function:
send_email()
{
echo "`date` \nCannot send files via $RESULT to ABC from `hostname`.
One other dilemma. The file represented by the variable $FTPDB_FILE, has about 9 of the first lines commented out so I would need to ignore any of the lines beginning with a ###.
Thank you in advance to anyone who is willing to help me out with this problem.
Thanks,
ryanildo