My code
#!/bin/sh
major=$(awk '$2=="module_dev" {print $1}' /proc/devices)
echo $major
mknod /dev/module_dev c $major 0
I'm practicing character device drivers, and this is one of the examples. The code above is ought to create a device driver file at /dev/ but there's an error that says
mknod: missing operand after '0'(it could be wrong because it's just a translation)
for more information type 'mknod --help'
This message was shown when I tried to create a device driver file (sh ***.h
)
I have no idea what the problem is. (insmod
is already done)