![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| If Statement Problem.. | LinuxRacr | Shell Programming and Scripting | 2 | 02-27-2008 12:47 AM |
| Case statement problem | gzs553 | UNIX for Advanced & Expert Users | 6 | 11-14-2006 04:24 PM |
| if statement problem | djt0506 | UNIX for Dummies Questions & Answers | 4 | 12-04-2005 08:16 PM |
| problem with an IF statement | hcclnoodles | Shell Programming and Scripting | 2 | 04-17-2003 11:53 AM |
| if statement problem | coughlin74 | UNIX for Dummies Questions & Answers | 1 | 09-27-2001 05:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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 ] |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|