Error:- Empty If - - can execute script on c shell
Hi,
I am trying to execute this small shell script in cshell, I am getting if: Empty if. Error. ---------------------- #!/bin/csh setenv COMP_FILES /NR/difference_files #/usr/sbin/sendmail user1@abc.com < $COMP_FILES/taskcomp/diff_task_tue_wed.txt setenv DAY `date | sed 's/ .*//'` #Email of comparison files if ($DAY == Mon) then /usr/sbin/sendmail user2@abc.com < $COMP_FILES/taskcomp/diff_task_fri_mon.txt ; else if ($DAY == Tue) then /usr/sbin/sendmail user2@abc.com < $COMP_FILES/taskcomp/diff_task_mon_tue.txt; else if ($DAY == Wed) then /usr/sbin/sendmail user2@abc.com < $COMP_FILES/taskcomp/diff_task_tue_wed.txt; else if ($DAY == Thu) then /usr/sbin/sendmail user2@abc.com < $COMP_FILES/taskcomp/diff_task_wed_thu.txt; else if ($DAY == Fri) then /usr/sbin/sendmail user2@abc.com < $COMP_FILES/taskcomp/diff_task_thu_fri.txt; else echo "try again" endif ---------------------------- |
Hi All,
I got the solution, then has to be in same line and if ($DAY =~ Mon) needs to be there... thnx |
You may want to read this: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
|
Thanks Chris
|
Quote:
|
All times are GMT -5. The time now is 10:43 PM. |