Guest Coke Posted July 8, 2004 Share Posted July 8, 2004 I have a script I wrote for generating network traffic. However I am having trouble using variables inside quotes. Perhaps someone could correct me. Here is my script: ================================== $answer = InputBox ( "How many Windows?", "Enter a Single Number", "1" ) $host = InputBox ( "Target?", "Enter a IP or valid host", "127.0.0.1" ) Do Run ( 'ping -l 55500 -w 0 -t $host' ) $answer = $answer - 1 Until $answer = 0 Exit =================================== How do I get the script to use the value of the variable? It takes it literally. Thanks! Coke Link to comment Share on other sites More sharing options...
emmanuel Posted July 8, 2004 Share Posted July 8, 2004 look up... at the stickey... it's a faq... you read it before you post... within you will find the answer.9. Why can't I print a variable using "My var is $variable"? "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Guest Coke Posted July 9, 2004 Share Posted July 9, 2004 look up... at the stickey... it's a faq... you read it before you post... within you will find the answer.9. Why can't I print a variable using "My var is $variable"?Thank you for posting. I read the FAQ and perhaps I had made a syntax error, however, your suggestion is working for me. Revised code below.Thanks.=============================$answer = InputBox ( "How many Windows?", "Enter a Single Number", "1" )$host = InputBox ( "Target?", "Enter a IP or valid host", "127.0.0.1" )Do Run ( 'ping -l 55500 -w 0 -t ' & $host ) $answer = $answer - 1Until $answer = 0Exit===================================Thank youCoke Link to comment Share on other sites More sharing options...
emmanuel Posted July 9, 2004 Share Posted July 9, 2004 and there was much rejoycing... yay. glad it worked out for ya. that one got me once too. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now