gpt4 book ai didi

linux - Udev:使用结果进行比较

转载 作者:太空宇宙 更新时间:2023-11-04 03:53:45 26 4
gpt4 key购买 nike

有人可以提示一下为什么会这样吗?

ACTION=="add", SUBSYSTEM=="block", PROGRAM="/bin/echo -n 12345", ENV{ID_FS_UUID}=="12345", RUN+="/path/to/some/script.sh %k %c $env{ID_FS_UUID}"

这不是吗?

ACTION=="add", SUBSYSTEM=="block", PROGRAM="/bin/echo -n 12345", ENV{ID_FS_UUID}=="%c", RUN+="/path/to/some/script.sh %k %c $env{ID_FS_UUID}"

最佳答案

您必须检查是否提供了 $result 来替换指定的 %c 位置。来自ma​​n udev:

$result, %c
The string returned by the external program requested with PROGRAM.
A single part of the string, separated by a space character, may be
selected by specifying the part number as an attribute: "%c{N}". If
the number is followed by the "+" character, this part plus all
remaining parts of the result string are substituted: "%c{N+}".

如果您没有提供正确的$result,那么这就是您的问题。

关于linux - Udev:使用结果进行比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25468490/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com