You are not logged in.
Pages: 1
Hello. Is there someone who can help me with this. I have pulseaudio up and running. I have a module for streaming music to my airport express. That is OK. I'm loading it with a script. If I want to unload that module I use "pactl unload-module" followed with the number of the module. That can be done once. If I load it again it gets another number so I can't write a script with "pactl unload-module <number>" I have this command to get the information about the module. pactl list | grep -B1 module-raop-sink | cut -d "" -f 3. Is it possible to tell my unload-script to use that information?
Offline
I don't have pulseaudio so I can't test this, but assuming the second command you posted returns only the number you could do this:
pactl unload-module `pactl list | grep -B1 module-raop-sink | cut -d "" -f 3`
Or:
number=`pactl list | grep -B1 module-raop-sink | cut -d "" -f 3`
pactl unload-module $number
Offline
Yep, it is called 'Command Substitution' look it up on man bash.
Or info. What is a good way to use info, I had to use
info bash Basic "shell expansion" "command substitution"
Offline
Thankyou for your reply but the output is more. It is
Module #16
Name: module-raop-sink
--
Description: RAOP sink '10.0.1.2'
Driver: module-raop-sink.c
--
Description: Monitor of RAOP sink '10.0.1.2'
Driver: module-raop-sink.c
Offline
With this I think I'm getting closer:
pactl list | grep -B1 module-raop-sink | cut -b 9-
The output then gives me
16
odule-raop-sink
tion: RAOP sink '10.0.1.2'
module-raop-sink.c
tion: Monitor of RAOP sink '10.0.1.2'
module-raop-sink.c
How do I get rid of everything below 16?
Offline
EDIT: Mis-read the previous post
Just dive in here: http://tldp.org/LDP/abs/html/index.html
Last edited by moljac024 (2009-04-12 13:26:37)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
Pipe it to head -n to get the first n lines.
Or you can do it like this:
pactl list | grep -B1 "Name: module-raop-sink" | grep "Module #" | cut -d "#" -f 2
Offline
Thankyou. That line gave me the number. Now I have to learn the rest.
Offline
Pages: 1