mknod error while trying to make a device driver file with shell mknod error while trying to make a device driver file with shell shell shell

mknod error while trying to make a device driver file with shell


The most likely cause of this error is that $major has no value. That is, $major is blank.

You have the echo statement there: what does it show? If you don't see anything, you might want to enhance it to show nothing enlightenlingly;

echo "major='$major'"

which will produce something like

major='213'

if all is well, and show empty quotes if it is working like I suspect.