Error in scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error in scripts
# 1  
Old 07-16-2008
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  
Old 07-16-2008
Tools 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  
Old 07-16-2008
p_region="ESAP"
if ( "$p_region" -eq 'ESAP' )
then
msg='YES'
else
msg='NO'
fi
echo $msg
# 4  
Old 07-16-2008
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  
Old 07-16-2008
Tools 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  
Old 07-16-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripts error

Dear all I have shell script where files have been organized into directory, i pass the directory name and it shold pick all the files within the directory and move to differnet path. When i run the scripts it doesn't move and come out with error and i am not able to understand it the... (2 Replies)
Discussion started by: guddu_12
2 Replies

2. Solaris

ksh scripts failing with cannot execute error

Hi, All the scripts placed in /home/bin had 755 permissions. Sometimes scripts are failing with cannot execute errors. Let me describe a simple scenario. MasterScript.sh had 755 permissions. It is success most of the times. But, sometimes failing with cannot execute error. Really... (1 Reply)
Discussion started by: sureng
1 Replies

3. HP-UX

Scripts to move files via FTP with error checking

Hi Members, Can members please advise or suggest how to write UNIX script which move all zip files in source directory and when done delete zip files from source directory? We want to delete only on successful transfer to the destination. secondly want to add some error checking if the FTP... (1 Reply)
Discussion started by: dxj0815
1 Replies

4. Shell Programming and Scripting

Getting error in shell scripts

Hi, I have a shell script confug-msys.sh which callls config-common.sh. When run from command prompt,these work fine but give the below error when i try to run from code-blocks line 7: --without-contrib: command not found ...Also I am unable to understand what the second script does...... (4 Replies)
Discussion started by: binnyshah
4 Replies

5. Shell Programming and Scripting

Advanced error handling in shell scripts

Hi all I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way). To handle errors in my scripts I... (3 Replies)
Discussion started by: script_man
3 Replies

6. Shell Programming and Scripting

Error Checking in Shell scripts.

What i need to do is when the database connection is not successful , the script should move to next list i.e skip the current. But when i do this - if ; then break; fi The script break but it goes to the condition - if ; then for LIST in $LISTS do for TABLE in $TABLES do... (2 Replies)
Discussion started by: dinjo_jo
2 Replies

7. Shell Programming and Scripting

Error trapping in parent/child scripts

Greets all. I'm using Slackware 12.0 with the bash shell. Calling my scripts with /bin/sh... I'm building gnome-2.18.3 and I have all my build scripts ready and working but I'm calling them from a parent script which executes each child/build script in a certain order (for loop). I have "set... (6 Replies)
Discussion started by: madpenguin
6 Replies

8. Solaris

Error with perl scripts...

hi on Solaris....m getting following error while running a perl script...any suggestions.... install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl: fatal: /home/oracle/lib32/libclntsh.so.9.0:... (1 Reply)
Discussion started by: Amardeep
1 Replies

9. UNIX for Advanced & Expert Users

Error Handling in Korn Shell scripts

Hi, I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise. Thanks, Gopi (4 Replies)
Discussion started by: bhgopi
4 Replies

10. HP-UX

Scripts for monitoring real time for the error code

Hi ! I wish extract one information(error code) from the machine which is running on the HP-UX platform. Can anyone help me? Wanted to write a scripts that monitor real time at the error code and transfer the information out from the machine. The information is then process and SMS out to the... (9 Replies)
Discussion started by: JOHNSON
9 Replies
Login or Register to Ask a Question