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
Error ^M not found while using read command raoscb UNIX for Dummies Questions & Answers 4 05-20-2008 10:37 AM
Ambiguous and Command not found Error in UNIX koti_rama UNIX for Dummies Questions & Answers 2 07-12-2007 08:44 AM
why emacs caused "command not found" error cy163 UNIX for Dummies Questions & Answers 1 05-01-2007 04:17 PM
how can i check in csh if command found or not found ? umen Shell Programming and Scripting 2 03-03-2007 07:38 PM
getting Ambiguous error on kill -9 @pid from csh umen Shell Programming and Scripting 0 03-02-2007 12:34 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-12-2007
koti_rama koti_rama is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 50
Ambiguous and Command not found Error in UNIX

Hi,All
I wrote below script(Example1.sh) and i ran but i got error. it's excuted yesterday.

SYSTEM_TIME=`date '+%H:%M:%S'`

CMP_LOG_TIME=`head -1 runcmp-HINET.log`

CMP_ENDED1=`grep 'HINET CMP ended' runcmp-HINET.log`

CMP_ENDED2=`echo "HINET CMP ended"`
CMP_FAILED2=`echo "HINET CMP failed"`
FAILED_TIME1="0"

echo $SYSTEM_TIME
echo $CMP_ENDED1


Error:
77 DIT1_hnt@smmk183> Example1.sh
SYSTEM_TIME=06:40:13: Command not found
CMP_LOG_TIME=`head -1 runcmp-HINET.log`: Ambiguous
CMP_ENDED1=: Command not found
CMP_ENDED2=`echo "HINET CMP ended"`: Ambiguous
CMP_FAILED2=`echo "HINET CMP failed"`: Ambiguous
FAILED_TIME1=0: Command not found
SYSTEM_TIME: Undefined variable


please help me on this
  #2 (permalink)  
Old 07-12-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,318
try putting quotes around the backticks like :
Quote:
CMP_ENDED2="`echo "HINET CMP ended"`"
  #3 (permalink)  
Old 07-13-2007
denn denn is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 96
every variable you have is giving the same error, that's a clue to the issue.

most likely your login id is defined as csh, and you did not define your "shebang line" as sh or ksh on your script, so it assumes csh syntax when you try to run the script. might want to google shebang line and read up on how to create a script vs. a file with commands.

insert at first line:
#!/usr/bin/ksh ( or whatever your path for ksh is; which ksh to locate correct path).
Sponsored Links
Closed Thread

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:27 AM.


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