if condition error: test: 0403-004 Specify a parameter with this command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting if condition error: test: 0403-004 Specify a parameter with this command
# 1  
Old 03-04-2012
if condition error: test: 0403-004 Specify a parameter with this command

Hi all,

I would like to ask if there's something wrong with my if - else condition, i couldn't run the script perfectly due to the error in my if - else condition stating that "test: 0403-004 Specify a parameter with this command."

below is the snippet of my script

Code:
if [ [ "${logFileName}"=="${logfName}" ] && [ "${paramTblName}"=="${tblName}" ] && [ "${startTimeStamp}"=="${startTime}" ] ]
then echo "true"
else echo "false
fi

any comments/suggestions is very much appreciated

regards,
Ivan
# 2  
Old 03-04-2012
Try:
Code:
if [ "${logFileName}"=="${logfName}" ] && [ "${paramTblName}"=="${tblName}" ] && [ "${startTimeStamp}"=="${startTime}" ]

This User Gave Thanks to bartus11 For This Post:
# 3  
Old 03-04-2012
Hi bartus11,

the code you had posted returned an error indicating that "syntax error on line 1 stdin".

Please advise

Regards,
Ivan
# 4  
Old 03-04-2012
Try single = instead of ==
This User Gave Thanks to Scrutinizer For This Post:
# 5  
Old 03-05-2012
You need to make sure all arguments in "if" is white space delimited.
Code:
if [ "${logFileName}" = "${logfName}" -a "${paramTblName}" = "${tblName}" -a "${startTimeStamp}" = "${startTime}" ]
then 
  echo "true"
else 
  echo "false"
fi

# 6  
Old 03-05-2012
thanks for the quick response, i had managed to run the if -else condition statement.

thanks and regards,
ivan
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A test command parameter is not valid, when special characters are tried to match

Hi I have a scenario where hyphen(-) from file should be ignored I used the following code if && ; then if ; then pow=$LINE echo $pow > history.txt flag=1 fi fi I get the following output ./valid.sh: -: 0403-012 A test... (7 Replies)
Discussion started by: Priya Amaresh
7 Replies

2. Shell Programming and Scripting

Help with error "por: 0403-012 A test command parameter is not valid."

Hi, im asking for help with the next script: echo ^; then if then printf "\033 query1.sh: export TERM=vt100 export ORACLE_TERM=at386 export ORACLE_HOME=/home_oracle8i/app/oracle/product/8.1.7 export ORACLE_BASE=/home_oracle8i/app/oracle export... (8 Replies)
Discussion started by: blacksteel1988
8 Replies

3. AIX

0403-027 The parameter list is too long on AIX 5.3

Hi we are using AIX 5.3 64bit I have near about 79000 log file having naming convention like "IFTMBCSun Aug 14 07:45:00 PAKST 2011". This naming convention was created by a script error, now we need to rename these log file by removing extar spaces and (:) colon for that we wrote below script ... (4 Replies)
Discussion started by: lodhi1978
4 Replies

4. Shell Programming and Scripting

unary operator expected, if condition test error.

Hi All, I'm assigning a numeric value to variable count=2, well its being assigned by code above the if condition. I want to test for 2 conditions , when $count = 0 or $count <=2 and do something when the condition matches. here is my code, but i run into the infamous : if ] then ... (2 Replies)
Discussion started by: Irishboy24
2 Replies

5. Shell Programming and Scripting

A test command parameter is not valid

Hello, Getting error "A test command parameter is not valid" when trying to run the code below under /sbin/sh AA = "12:00" CHK=$(date +"%H:%M") if then print "Yes" fi Getting 2 errors: 1) "AA: not found" 2) "Specify a parameter with this command" Thanks, IS Please... (5 Replies)
Discussion started by: schureki
5 Replies

6. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

7. UNIX for Dummies Questions & Answers

UNIX: 0403-027 The parameter list is too long

Hello All, We have a batch job that clean old records. This run a script to back up file then delete. Unfortunately, this job been failing lately. This is the error we received. "/usr/bin/compress: 0403-027 The parameter list is too long." I am not sure if the job failed since its... (2 Replies)
Discussion started by: juieshenkei
2 Replies

8. UNIX for Dummies Questions & Answers

0403-027 The parameter list is too long.

hi when i ran the following command rm *_F i got this error 0403-027 The parameter list is too long. It shd remove 5000(around) files pls help me on this. why its throwing this error how to rectify this error (5 Replies)
Discussion started by: romiljain
5 Replies

9. Shell Programming and Scripting

Help regarding Error message: A test command parameter is not valid

Hi I am getting few messages when trying to run my script from the following lines in the script if test then // SomeCode fi The messages are as follows: testing.sh: OBLIGOR_GROUP_ID: 0403-012 A test command parameter is not valid. testing.sh:... (5 Replies)
Discussion started by: skyineyes
5 Replies

10. UNIX for Dummies Questions & Answers

Grep 0403-027 The parameter list is too long.

Hi there I get this error message when I try to do a basic grep. Does anyone have any ideas what is wrong. Thanks 0403-027 The parameter list is too long. (1 Reply)
Discussion started by: japada
1 Replies
Login or Register to Ask a Question