![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cron issue | kingdbag | SUN Solaris | 5 | 07-10-2008 08:14 AM |
| Another Cron issue. | Beefy | UNIX for Dummies Questions & Answers | 2 | 03-13-2008 09:30 AM |
| FTP Cron Issue | edua | Shell Programming and Scripting | 7 | 11-26-2007 11:30 PM |
| Issue with cron job | nattynatty | Shell Programming and Scripting | 1 | 11-21-2005 03:37 PM |
| cron issue | Optimus_P | UNIX for Advanced & Expert Users | 5 | 08-26-2002 10:30 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Issue with cron job -Please help
Hi ,
I have an issue with cron job that i have scheduled today. The problem is that when i run this script in command prompt it work good giving me the desired results but if i schedule this to run using cron job it failes giving a "syntax error in line 11 :$"..... Can anyone look into this and let me what to do.....Basically the script works to find a charater in the very first line of a records which is about 10000 lines and gives me an output if the charater is there or not. PLease ...please some one help me out THis is the script that i am using: FROM_DIR=/home/sandy_home/cc3; export FROM_DIR LOG_DIR=/home/sandy_home/log_dir; export LOG_DIR echo "NUMBER OF cc3 files BEFORE process STARTS-IF A FILE IS MISSING/NOT TRANSFERRED CONTACT Sandeep" > $LOG_DIR/che ckfile.log cd $FROM_DIR ls -l *.cc3 >> $LOG_DIR/checkfile.log for ccfile in $FROM_DIR/*.cc3 do line=$(head -1 $ccfile) if [[ $line = *ID* ]]; then echo "----------------------------FOUND ID in $ccfile------------------------------" >> $LOG_DIR/checkfile.log else echo "---------------------------- ID NOT FOUND in $ccfile--------------------------" >> $LOG_DIR/checkfile.log mv $ccfile /home/sandy_home/failed echo "-----------The file that had no ID has been moved to failed directory---" >> $LOG_DIR/checkfile.log fi; done |
| Forum Sponsor | ||
|
|
|
|||
|
Thanks for the help, I tried this and it worked:
strline=`head -1 $ccfile | cut -c1-10` if [ "$strline" = "$sandeep_TXT" ] and exported sandeep_TXT in in the script: sandeep_TXT="ID"; export sandeep_TXT Thanks again for ur help Last edited by bsandeep_80; 07-27-2007 at 11:27 AM. Reason: change |
|||
| Google The UNIX and Linux Forums |