how to close 'else' statement block in bash script
if (a=b)
xxxxxx xxxxxx fi else xxxx xxxx how do i close the else block? with esle?? thanks. |
the else is nested between the if and fi
|
something like that:
if (a=b) xxxxxx xxxxxx else xxxx xxxx fi |
sweet. I feel stupid not to think of that. thanks.
|
Is there a way to scan for input from user (stdin) is a bash script.
for example echo "press y/n to answer" scan $ans |
Code:
read ans NOTE: Don't say $ans. $ans replaces itself with the value stored in ans. If, for example, $ans contained "foo", "read $ans" would be equivalent to saying "read foo" which would read one line from standard input and store it in the environment variable foo. |
|
thanks.
|
Here's a bash program I wrote that you might like..
It has examples of both things you want to do.. Mod Edit: Link Removed I wrote that program to take a list of MACs that have no associated IP I steal using Kismet from a wifi network with MAC filtering on and use that list to change my wifi mac address to "steal" and IP. It's useful :-P |
SirSlappy, reread the Rules - LQ does not condone or encourage cracking.
|
All times are GMT -5. The time now is 05:16 AM. |