[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: USB via ethernet

Stephen Liu wrote:

Hi Jody

modprobe usbnet # insert usbnet module (USB via ethernet)

pump -i # DHCP request, -i option to precise which interface to use

`dmesg | grep CDC | awk -F: ‘{ print $1; }’` # look in dmesg output
in order to find ethernet interface information (eth1 for example)

If I understand it correctly, it should be one command line;

# modprobe usbnet \
 pump -i \
 `dmesg | grep CDC | awk -F: ‘{ print $1; }’`
No. It's two command lines:

modprobe usbnet &&
(( runs the modprobe command, and only runs the next command if the modprobe succeeds))
pump -i ` dmesg | awk -F: '/CDC/{print $1;}' `

this runs pump with (hopefully) two parameters.
The first is '-i'
The second is the output of dmesg | awk -F: '/CDC/{print $1;}'

Note that I've changed it from grep CDC | awk -F: ....
to awk -F: '/CDC/.....'

awk allows filtering of which lines to work on, and /CDC/ says to
only work on lines that match the Regex 'CDC' (i.e. same as doing the grep).

Stephen Samuel +1(604)450-0066             samnospam@bcgreen.com
  Powerful committed communication. Transformation touching
    the jewel within each person and bringing it to light.

Reply to: