Ai
3 Star 1 Fork 1

Gitee 极速下载/linuxconsole

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/flosse/linuxconsole
克隆/下载
extract 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/awk -f
# Extracts the settings for a given joystick from the joystick
# parameter file, matching the contents of the kernel, name, serial,
# vendor and product variables (typically specified on the command
# line), repectively kernel device, joystick name, joystick serial
# number, USB vendor code, USB product code.
# The exit code is 0 if a section was found, 1 otherwise. If multiple
# sections match, only the first is kept.
BEGIN {
FS = "\"";
seckernel = "";
secname = "";
secserial = "";
secvendor = "";
secproduct = "";
}
/^DEVICE=/ {
seckernel = $2;
}
/^NAME=/ {
secname = $2;
}
/^SERIAL=/ {
secserial = $2;
}
/^VENDOR=/ {
secvendor = $2;
}
/^PRODUCT/ {
secproduct = $2;
}
/(^js)|(^$)/ {
# Command or empty line, ends the match criteria for a given
# section
if ((kernel == "" || seckernel == kernel) &&
(name == "" || secname == name) &&
(serial == "" || secserial == serial) &&
(vendor == "" || secvendor == vendor) &&
(product == "" || secproduct == product)) {
# The section matches, output the command or exit if we've
# reached the end of the section
if ($0 ~ /^js/) {
print $0;
} else {
exit 0;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/linuxconsole.git
git@gitee.com:mirrors/linuxconsole.git
mirrors
linuxconsole
linuxconsole
master

搜索帮助