AlphaFemale
03-27-2002, 01:34 PM
Im writing a much larger script, but I need some help on some awk/prtinf (as I dont use them that often).
Basically part of the script is to login to a machine and grab the ethernet device, which is either elxl0 or iprb0 (this is solaris)...
I have thus, so far:
rsh computer_name /usr/sbin/ifconfig -a | awk '/elxl/ || /iprb/ {printf $1}'
This will return:
elxl0:
or
iprb0:
This is almost perfect, except I need to chop off the : charactor. I dont want to limit the field size or anything in case I ever add differnt type of ethernet devices. I know its really simple, but for the life of me I cannot remember what I need to pass to printf to cut that ':' off.
[ 27 March 2002: Message edited by: AlphaFemale ]
Basically part of the script is to login to a machine and grab the ethernet device, which is either elxl0 or iprb0 (this is solaris)...
I have thus, so far:
rsh computer_name /usr/sbin/ifconfig -a | awk '/elxl/ || /iprb/ {printf $1}'
This will return:
elxl0:
or
iprb0:
This is almost perfect, except I need to chop off the : charactor. I dont want to limit the field size or anything in case I ever add differnt type of ethernet devices. I know its really simple, but for the life of me I cannot remember what I need to pass to printf to cut that ':' off.
[ 27 March 2002: Message edited by: AlphaFemale ]