excuse my stupidity


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting excuse my stupidity
# 1  
Old 02-18-2002
excuse my stupidity

I am getting a variable from a web page ($inst) which is looked at by the loop:

if ($inst == 2)
{
do stuff
}

the problem is that no matter what the value of $inst the code enters the loop. I know it is some thing small and stupid, but any help would be appreciated.
john
# 2  
Old 02-18-2002
Please post the rest of your code and what shell and operating system you are using.Smilie
# 3  
Old 02-18-2002
agreed... not enough info

however, a couple of things you might like to try with the process of elimination

print (echo, printf, whateva) depending on what your coding in. You would firstly make sure that your condition is accurate with the variable. If it doesn't equal 2, you have a problem with your condition, probably the syntax. However, if it always equals 2 maybe you should look at what that variable is doing. Maybe something wrong elsewhere and if that is the case you will have to post more info.

if ($inst == 2)
{
do stuff ; print $inst
}

AND/ OR

print $inst
if ($inst == 2)
{
do stuff ;
}
Shakey21
# 4  
Old 02-18-2002
I did not read the shell you are using (and that makes quite a difference)... on the otherhand, you might just try:

if ($inst == 2) then
{
do stuff
}
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

My own stupidity

Hello, I've made a major faux pas by deleting a partition which I thought only contained an older version of Linux. Much to my surprize I reboot and I end up at the GRUB prompt and have lost the ability to enter anything with my USB keyboard or so I thought...I tried the PS/2 keyboard to no avail.... (1 Reply)
Discussion started by: viennarobot
1 Replies

2. What is on Your Mind?

What can you do when you need to find an excuse in a hurry?

try this, telnet towel.blinkenlights.nl 666 another mindless timewaster when you're bored of twiddling your thumbs :D (0 Replies)
Discussion started by: sparcguy
0 Replies
Login or Register to Ask a Question