The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-18-2009
bobb bobb is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 2
Referring from the print of the previous command

Hi,

I am a newbie in SHell Programming.
I want to ask something about referring the result of the previous command in Shell-Prog.

For example :
bnm@dsds~> ifconfig

eth0 Link encap:Ethernet HWaddr 00:0B:CD:85:A5:8A
inet addr:192.168.0.2 Bcast:192.168.0.225 Mask 255.255.255.0


bnm@dsds~> next command ???


My question is : What should i type as the next command ??? using
the if-statement below :
--------------
if [ HWaddr is equal to 00:0B:CD:85:A5 ]; then
.....
fi
--------------
so that it will refer to the HWaddr 00:0B:CD:85:A5 printed
as the result of the previous command ?


Thanks in advance.

Bob