您的位置:首页 > 其它

运行LDD3的例程scull中的scull_load时,出现了很多错误

2016-06-16 15:53 876 查看
运行LDD3的例程scull中的scull_load时,出现了很多错误:

awk: 0: unexpected character ‘\’

awk: line 1: syntax error at or near ==

mknod: missing operand after
0'

Try
mknod –help’ for more information.

mknod: missing operand after
1'

Try
mknod –help’ for more information.

mknod: missing operand after
2'

Try
mknod –help’ for more information.

mknod: missing operand after
3'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/scull[0-3]': No such file or directory

chmod: cannot access
/dev/scull[0-3]’: No such file or directory

mknod: missing operand after
4'

Try
mknod –help’ for more information.

mknod: missing operand after
5'

Try
mknod –help’ for more information.

mknod: missing operand after
6'

Try
mknod –help’ for more information.

mknod: missing operand after
7'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/scullpipe[0-3]': No such file or directory

chmod: cannot access
/dev/scullpipe[0-3]’: No such file or directory

mknod: missing operand after
8'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/scullsingle': No such file or directory

chmod: cannot access
/dev/scullsingle’: No such file or directory

mknod: missing operand after
9'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/sculluid': No such file or directory

chmod: cannot access
/dev/sculluid’: No such file or directory

mknod: missing operand after
10'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/scullwuid': No such file or directory

chmod: cannot access
/dev/scullwuid’: No such file or directory

mknod: missing operand after
11'

Try
mknod –help’ for more information.

chgrp: cannot access
/dev/scullpriv': No such file or directory

chmod: cannot access
/dev/scullpriv’: No such file or directory

解决办法:

原因:ubuntu里面的awk有点问题

办法:

1)apt-get install gawk

2)将scull_load中的
major=$(awk "\\$2==\"$module\" {print \\$1}" /proc/devices)


改为:
major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices)


之后,再次运行scull_load就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  awk LDD3 scull scull-load