character device failure TODO, mknoddev use awk

This commit is contained in:
Ciro Santilli
2017-08-06 12:41:05 +01:00
parent dab04d1852
commit f67d99ff24
2 changed files with 5 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/sh
dev="$1"
major="$(grep "$dev" /proc/devices | cut -d ' ' -f 1)"
major="$(awk -F ' ' '$2 == "'"$dev"'" { print $1 }' /proc/devices)"
mknod "/dev/$dev" c "$major" 0