Unloading OSS

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Kaye

Unloading OSS

Post by Kaye »

Hey everyone,

I want a small script that will kill all of the processes using OSS, run soundoff, then run soundon (for me to use after I suspend).

This script seems to work for some people:

Code: Select all

#!/bin/sh
processes=`sudo soundoff | grep ^[0-9] | gawk '{print $1}'`
for process in ${processes[@]}
do
    echo `ps  $process`
    kill $process
done

echo "restarting the oss process"
sudo soundon
But for me gives this error:

Code: Select all

jordan@jordanlaptop ~ $ /usr/lib/pm-utils/sleep.d/48oss.sh
/usr/lib/pm-utils/sleep.d/48oss.sh: 7: Bad substitution
I'm not really familiar enough with bash to fix this (though I've tried!) Can anyone help?

Thanks,
Kaye
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
garda

Re: Unloading OSS

Post by garda »

If it is supposed to be a Bash script, you have to change the header from #!/bin/sh to #!/bin/bash.
Kaye

Re: Unloading OSS

Post by Kaye »

Durrrrrrrr. Thank you for not calling me an airhead.. I kinda deserved it :roll:

Edit: One other question, is there any way for me to set this script up to run every time I wake the laptop up, or will I just have to run it manually every time? Thanks.
Last edited by Kaye on Mon Mar 09, 2009 4:05 pm, edited 1 time in total.
garda

Re: Unloading OSS

Post by garda »

We make mistakes once in a while. Some times a big one while some other times, a small one but misses the eyes. :)
Locked

Return to “Software & Applications”