[Eisfair] udev-Regel nach SCSI-ID

Marcus Roeckrath marcus.roeckrath at gmx.de
Di Aug 29 18:05:18 CEST 2017


Hallo Detlef,

Detlef Paschke wrote:

> IMPORT{program}= ist wohl nicht ganz das was ich nutzen muss. Mein
> schlechtes Englisch hat mich hier https://linux.die.net/man/7/udev daz
> geführt nur PROGRAM zu nutzen.

PROGRAM
    Execute a program. The key is true, if the program returns successfully.
The device properties are made available to the executed program in the
environment. The program's output printed to stdout, is available in the
RESULT key. 
RESULT
    Match the returned string of the last PROGRAM call. This key can be used
in the same or in any later rule after a PROGRAM call.

Das ist aus Deinem Link, wonach die Ausgabe von PROGRAMM über RESULT
abgerufen werden kann/muss/soll.

> Das funktioniert:
> PROGRAM=="/bin/echo $env{ID_PATH}"
> 
> Das %c unter Symlink gibt dann den vollen ID_PATH an.
> 
> Aber mit cut nicht mehr:
> PROGRAM=="/bin/echo $env{ID_PATH} | cut -d- -f4"

Gib auch bei cut mal den vollen Pfad an: /usr/bin/cut.

Leite doch mal in der PROGRAMM-Zeile die Ausgabe in eine Datei um, damit man
sieht, ob nach dem cut nochwas da ist.

-- 
Gruss Marcus


Mehr Informationen über die Mailingliste Eisfair