#!/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
Pastebin
Recent changes
2401:4900:1F2A:8FFF:0:0:19A:5EFE • 1 month ago
Harsharose • 1 month ago
Harsharose • 1 month ago
2607:FB90:EAC3:85A9:897A:CA2C:7CC3:E11B • 2 months ago