LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-25-2013, 02:21 AM   #1
cazzette
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: Disabled
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!
 
Old 04-25-2013, 02:04 PM   #2
cazzette
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
External storage device question satimis Linux - Hardware 3 02-17-2011 11:20 PM
[SOLVED] Udev creates the external usb hard disk device node too late pastoreerrante Linux - Software 2 05-24-2010 01:42 AM
A question regarding external device access dongbo Programming 2 11-18-2009 05:12 AM
Using udev to tell Ubuntu to use the proper device on a multiple USB device Jeff91 Linux - Hardware 20 08-20-2009 01:10 PM
udev and a new device jmoody Linux - Software 12 10-11-2007 01:32 PM


All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration