The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 11:16 AM
syntax error at line 59: `end of file' unexpected Remi SUN Solaris 4 01-16-2007 02:48 PM
syntax error at line 33: `elif` unexpected hazy UNIX for Dummies Questions & Answers 4 02-09-2006 02:51 PM
sh: syntax error at line 1: `>' unexpected atiato High Level Programming 2 03-16-2004 07:39 AM
syntax error: `(' unexpected adadevil UNIX for Dummies Questions & Answers 11 12-14-2001 09:17 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-22-2004
alan's Avatar
alan alan is offline
Registered User
  
 

Join Date: Jul 2003
Location: Los Angeles
Posts: 53
Question sh: syntax error: `...' unexpected???

Hello all,

I want to create a script that polls every hour a directory for the existence of a file. The file I look for is a `token` dropped by an external process at the completion of a successful FTP process. I wrote this script `checkfile.ksh`:

#!/usr/bin/ksh

if [[ -e $HOME/tokenfile ]] then
mailx -s "Token file found! Data files received!" email_address < $HOME/emptyfile
fi
exit


To test it, I touched a file (`tokenfile`) in my $HOME directory, ran my script and got this error

sh: syntax error at line ...: `$HOME/core' unexpected


I declared the file name as a variable
: ${COREFILE:=/$HOME/tokenfile}... [[ -e $COREFILE ]]
but got the same error

sh: syntax error at line ...: `$HOME/COREFILE' unexpected


What the @!*%%# (sorry!) am I missing here?? I run this script as the owner of the directory, I have the default `umask` value (not sure if it matters) and I run HP-UX B11.11.

Any help is welcome. I feel like the solution is here: I am just not seeing it.

TIA!!!

Al.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0