Search Results

Search: Posts Made By: malfolozy
5,352
Posted By Scrutinizer
That is because 1. is in the first field, you...
That is because 1. is in the first field, you should use it in the second field, see my example in post #6 .
5,352
Posted By Scrutinizer
There are two fields for every menu item in...
There are two fields for every menu item in whiptail. The first field is the choice that will be returned after selection, the second field is just a description..

So then you could just use:...
5,352
Posted By Scrutinizer
I would use the number in the second column so...
I would use the number in the second column so that the value that you obtain is the name of the interface (and so then you do not need a case statement).. Otherwise you just get a number and how...
5,352
Posted By Scrutinizer
You could try: array=($(ifconfig -a | awk...
You could try:

array=($(ifconfig -a | awk '{print $1, "Interface_"NR}' RS= ) )

There are many possibilities
5,352
Posted By Scrutinizer
Hi try: array=($(ifconfig -a | sed -n 's/^\([^...
Hi try:
array=($(ifconfig -a | sed -n 's/^\([^ ]\+\).*/\1 \1/p') )

You need two strings per item..
5,352
Posted By Corona688
What's your system? There may be more convenient...
What's your system? There may be more convenient ways than ifconfig to get device names.

Dumping data into arrays is often -- usually -- not the answer.

BASH -- and most modern Bourne shells...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy