Content added Content deleted
(Need to display all IPs on machine 1. 123.123123 <newline> 2. 222.22.22.22 <newline> 3. 21.21.21.21 etc etc.. then have it say Choose which IP to use Prompt user for a number 1-NUMIPS) |
imported>mutante mNo edit summary |
||
Line 1: | Line 1: | ||
<pre> |
|||
#!/bin/bash |
#!/bin/bash |
||
Line 11: | Line 12: | ||
COUNT=`expr $COUNT + 1` |
COUNT=`expr $COUNT + 1` |
||
done |
done |
||
</pre> |
Revision as of 00:37, 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