![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| determine if the script has been invoked manually or not? | hitmansilentass | Shell Programming and Scripting | 8 | 06-22-2008 11:32 AM |
| SFTP errorcode 1 when run on cron but runs manually | Heidi.Ebbs | SUN Solaris | 2 | 08-08-2007 12:16 PM |
| script works on command line, not in cron job | JackTheTripper | UNIX for Dummies Questions & Answers | 7 | 06-27-2007 01:51 AM |
| how to implement patch manually | sheilly_2k7 | UNIX for Advanced & Expert Users | 1 | 05-03-2007 05:57 PM |
| Can run script Manually, but not through Cron? | MadHatter | Shell Programming and Scripting | 4 | 10-19-2005 10:08 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Works Manually - not in CRON
I've got a ksh script that works like a charm when I run it manually. When I set it up in a cron, I keep getting this error in my log:
syntax error at line 90: `$' unexpected Here's my snippet of code starting at line 90: while [[ ! -e $DATA_DIR/tuscprof.dat && $(date '+%H:%M') < 10:00 ]] do sleep 900 done What's the problem? |
|
||||
|
It already has this line at the top, after the path:
. /usr/local/bin/TEST.env PATH=/usr/lbin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/sbin:/bin:/usr/local/bin:$ORACLE_HOME:$ORACLE_HOME/bin:/apps:.; export PATH SHELL=/bin/ksh export SHELL Mind you, this was not my original script so I don't know much about certain portions of it, including this one |
|
||||
|
Quote:
|
|
||||
|
Quote:
The very first line of the script needs to be #! /usr/bin/ksh. This forces the execution shell to become a Korn shell and not SH as is your case. The specific line cannot come after anything and it must be line 1. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|