The UNIX and Linux Forums  


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
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 02:45 PM
Error trapping in parent/child scripts madpenguin Shell Programming and Scripting 6 08-10-2007 10:11 AM
Error with perl scripts... Amardeep SUN Solaris 1 06-19-2006 10:07 AM
Error Handling in Korn Shell scripts bhgopi UNIX for Advanced & Expert Users 4 09-06-2005 07:44 PM
Scripts for monitoring real time for the error code JOHNSON HP-UX 9 10-07-2003 04:08 PM

Closed Thread
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
  #1 (permalink)  
Old 07-16-2008
yogichavan yogichavan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 3
Error in scripts

I am using following code but getting error
Error on line 136:
(SQR 3710) Unknown argument type.

Given below part of program where i am getting error.......

input $p_region type=char

if ( '$p_region' = 'ESAP' )
let $msg = 'YES'
do log_msg ({PROG_NAME}, {SEV_INFO}, $msg)
else
let $msg = 'NO'
do log_msg ({PROG_NAME}, {SEV_INFO}, $msg)
fi


could you please let me know what is the solution for this.
  #2 (permalink)  
Old 07-16-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Cool Two things come to mind

... although I might be wrong.

But,
(a) when there is an if there is normally a then -- did not see it.
(b) where you use ' single quotes, I have found that this does not quite the same variable substitution; thus using " double quotes often does the correct substitution.
  #3 (permalink)  
Old 07-16-2008
sudhamacs sudhamacs is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 98
p_region="ESAP"
if ( "$p_region" -eq 'ESAP' )
then
msg='YES'
else
msg='NO'
fi
echo $msg
  #4 (permalink)  
Old 07-16-2008
ynilesh's Avatar
ynilesh ynilesh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 222
If i m not making mistake, for me it doesnt look like a shell code ?
It would be better if you could explain what you are trying to do so we can suggest you some other possible and easy ways.

- nilesh
  #5 (permalink)  
Old 07-16-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Cool is equals ??

If this is a unix script, then -eq is for integers.
Perhaps

Code:
if ( "$p_region" -eq 'ESAP' )

should be

Code:
if [ "$p_region" = "ESAP" ]

???
  #6 (permalink)  
Old 07-16-2008
crystal_pup crystal_pup is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 7
Can we use round brackets in if command?

if ( '$p_region' = 'ESAP' )

should be

if [ '$p_region' == 'ESAP' ]

Also 'then' part is missing in the script.
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 12:27 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