Content added Content deleted
imported>mutante mNo edit summary |
No edit summary |
||
Line 12:
COUNT=`expr $COUNT + 1`
done
# -----------------
# I need to display all ips like this to user:
#
# 1. 123.123.123.123
# 2. 22.22.22.22
# 3. 32.32.32.222
#
# Please choose which IP address to use:
# Prompt user here
</pre>
|
Revision as of 00:39, 25 February 2005
#!/bin/bash IPS=$(ifconfig | awk '/inet/ { print $2 }' | awk -F ":" '{ print $2 }') NUMIPS=$(echo $IPS | wc -w) COUNT=1 for i in $IPS do export IP$COUNT=$i COUNT=`expr $COUNT + 1` done # ----------------- # I need to display all ips like this to user: # # 1. 123.123.123.123 # 2. 22.22.22.22 # 3. 32.32.32.222 # # Please choose which IP address to use: # Prompt user here