linux - Bash - Display menu with network interfaces as options -


i total bash newbie, , need make script has menu each of options 1 of available network interfaces of system. user must choose 1 of options.

so basically, looking (when executed).

 please, select network interface:  1)eth0 2)eth1 3)lo  

and user can input 1, 2 or 3 select 1 of options.

any appreciated. lot!

try this:

echo "please, select network interface:" cd /sys/class/net && select foo in *; echo $foo selected; done 

output:

 please, select network interface: 1) eth0 2) lo #?  

see: help select , this example see how use select , case.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -