![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If Statement Problem.. | LinuxRacr | Shell Programming and Scripting | 2 | 02-26-2008 08:47 PM |
| Case statement problem | gzs553 | UNIX for Advanced & Expert Users | 6 | 11-14-2006 12:24 PM |
| if statement problem | djt0506 | UNIX for Dummies Questions & Answers | 4 | 12-04-2005 04:16 PM |
| problem with an IF statement | hcclnoodles | Shell Programming and Scripting | 2 | 04-17-2003 07:53 AM |
| if statement problem | coughlin74 | UNIX for Dummies Questions & Answers | 1 | 09-27-2001 01:31 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
||||
|
problem with if statement equality
Here's my script:
/bin/script.sh echo "hey __, don't forget the password is "kazlo"" echo "insert the name of your file in the next line, be very specific" read var1 vartest=`find . | grep "$var1"` echo $vartest echo "you sure this is the right file? answer next line with (y/n)" read var2 if test [$var = "y"] then scp "$vartest" username@targetserver.org:/Users/username/ echo hopefullyworks fi it just skips over my if statement this is really simple i'm sure but I can't get it to work any help appreciated |
| Forum Sponsor | ||
|
|
|
|||
|
Either
if [ $var = "y" ] then scp "$vartest" username@targetserver.org:/Users/username/ echo hopefullyworks fi Or if test $var = "y" then scp "$vartest" username@targetserver.org:/Users/username/ echo hopefullyworks fi Both test and [] are not required then if u use [] then give space after and beore [ and ] |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|