Parameter checks -


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Parameter checks -
# 1  
Old 08-27-2010
Parameter checks -

Another stupid question.

Why does this work on our Solaris box but not on our much newer red hat box...

Code:
if [$1 = test ]
 then 
      echo "running in test"
else 
       echo "running in live"

I assume I am missing something between the [].

Any help is of course greatly appreciated.
# 2  
Old 08-27-2010
Hi.

(overlooking the missing space after [, the missing fi and that $1 would be better quoted) what does not work about it?
This User Gave Thanks to Scott For This Post:
# 3  
Old 08-27-2010
it was the double quotes.

unix version didn't need them, I already used them in the linux but just over looked them. Some parts are still not working as expected but I just needed a second set of eyes to spot the obvious.

I appreciate it.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call Script with Parameter (that has another parameter)

Hi. How do I achieve this sh /EDWH-DMT02/script/MISC/exec_sql.sh "@/EDWH-DMT02/script/others/CSM_CKC/Complete_List.sql ${file_name}" Complete_List.txt The /EDWH-DMT02/script/MISC/exec_sql.sh has two parameters and it's working fine with this sh /EDWH-DMT02/script/MISC/exec_sql.sh... (7 Replies)
Discussion started by: aimy
7 Replies

2. Shell Programming and Scripting

Resolving a parameter which is passed as parameter

Hi, I have the following files. ->cat scr.sh export TMP_DIR=/home/user/folder1 export TMP_DIR_2=/home/user/folder2 while read line do cat "$line" done<file_list.dat ------------------------ -> cat file_list.dat $TMP_DIR/file1.txt $TMP_DIR_2/file2.txt --------------------------- -> cat... (6 Replies)
Discussion started by: barath
6 Replies

3. Shell Programming and Scripting

How to get the parameter value from the parameter file in perl?

hi all, i have a parameter file of following format, i want a method which can get the value of specific parameter. parameter file format: <Parameter Name="FileLocationWindows"> <Description> The directory location of the logger file. ... (1 Reply)
Discussion started by: laxmikant.hcl
1 Replies

4. Shell Programming and Scripting

Passing parameter to script, and split the parameter

i am passing input parameter 'one_two' to the script , the script output should display the result as below one_1two one_2two one_3two if then echo " Usage : <$0> <DATABASE> " exit 0 else for DB in 1 2 3 do DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}` done fi (5 Replies)
Discussion started by: only4satish
5 Replies

5. Shell Programming and Scripting

Command that takes one parameter and then searches for the passed in parameter

Hi I am looking for a unix command or a small shell script which can takes one parameter and then searches for the passed in the parameter in any or all files under say /home/dev/ Can anyone please help me on this? (3 Replies)
Discussion started by: pankaj80
3 Replies

6. Shell Programming and Scripting

Daily Checks

Hey Guys, I'm seeking some assistance in getting this script to run as a cron job for the user oracle.. the script is basically to perform 2 ADRCI checks... see the script below... i'm getting the following error: /export/home/oracle/Daily_Checks/ADRCI_Daily_Checks.sh: syntax error at line 16:... (7 Replies)
Discussion started by: Racegod
7 Replies

7. AIX

Pre-checks

AIX Guys!!! What pre-checks would you do on a 5.3 server before TL/SP/APAR installation? Bala (2 Replies)
Discussion started by: balaji_prk
2 Replies

8. UNIX for Dummies Questions & Answers

health checks

Hello Anyone please help me with a health check script on HP-UX. (1 Reply)
Discussion started by: mahlathini
1 Replies

9. Shell Programming and Scripting

how do I make dynamic parameter names? Or get the value of a parameter evaluated twi

Say I write something like the following: var1=1 var2=2 for int in 1 2 do echo "\$var$int" done I want the output to be: 1 2 Instead I get something like: $var1 $var2 (2 Replies)
Discussion started by: Awanka
2 Replies
Login or Register to Ask a Question