LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   udev question: using external programs to name device (https://www.linuxquestions.org/questions/linux-general-1/udev-question-using-external-programs-to-name-device-4175459516/)

cazzette 04-25-2013 01:21 AM

udev question: using external programs to name device
 
Hi all, I'm stuck on this udev rule. I want to use a shell script to name a device.

/etc/udev/rules.d/00-cazzette.rules:
KERNEL=="sr0", PROGRAM="/etc/cazzette %k", SYMLINK+="%c"

/etc/cazzette:
echo cazzette_$1

This should name my device as /dev/cazzette_sr0, correct? For some reason, it's not working. Can someone give me a tip why it's not?

What I want to do is actually much more complicated. I want to eventually do something like PROGRAM="/etc/cazzette %p" and run the devpath through a bunch of find/cut/awk/sed/etc.

Thanks!

cazzette 04-25-2013 01:04 PM

I think I figured it out. I needed a shebang (#!/bin/sh) in /etc/cazzette. Didn't think it was that critical to cause it to fail.


All times are GMT -5. The time now is 01:30 AM.