07-15-05 11:05 PM
Hi,
I am a relative newbie to BASH programming but I've read and learned a
lot but I can't seem to solve my problem. I am trying to figure out the
major number of a device through cat /proc/devices piped to awk:
cat /proc/devices | awk '/theDeviceName/ { printf $1 }'.
I am trying to write a function that receives the device name as an
argument:
function find_major()
{
MAJOR=`cat /proc/devices | awk '/$1/ { printf $1 }'`
# do some other work...
}
I have tried this:
function find_major()
{
MAJOR=`cat /proc/devices | awk '/$1/ { printf \$1 }'`
# do some other work...
}
and some other alternatives but just can't seem to get it to work. Can
anyone help?
Thanks in advance!!
HK
[ Post a follow-up to this message ]
|