Le Samedi 24 Juin 2006 11:21, Alvin a écrit :
#!/bin/sh # Copyright (c) 2005, Alvin Beach # Script Name: gamesnd # Platform: SuSE 9.3 Professional # Date: June 20, 2005 # Description: Setups up sound for various games ### BEGIN INIT INFO # Provides: gamesnd # Required-start: alsasound # Required-stop: # Default-start: 5 # Default-stop: # Description: Setups up sound for various games ### END INIT INFO
# List of games GAMES="et.x86 doom3"
echo "Adding sound support for games:" for g in ${GAMES}; do echo -en "\t${g}\t" echo "${g} 0 0 direct" > /proc/asound/card0/pcm0p/oss
if [ $? -eq 0 ]; then echo "done" else echo "failed" fi done
Hi Alvin, hi everybody, I am unfortunatly far from beeing a (good) shell programer. Running the script "by hand" and as root gives this: patrick:/etc/init.d # ./gamesnd Adding sound support for games: ./gamesnd: line 24: syntax error near unexpected token `then' ./gamesnd: line 24: ` if [ $? -eq 0 ]; then' and I dont see anything in the script like hidden caracter or whatever... the command worked stand alone: patrick:/etc/init.d # cat /proc/asound/card0/pcm0p/oss patrick:/etc/init.d # echo "et.x86 0 0 direct" > \ proc/asound/card0/pcm0p/oss patrick:/etc/init.d # cat /proc/asound/card0/pcm0p/oss et.x86 0 0 direct So, after these last command, I tryed starting the game by cliking an icon on a user desktop... no sound. Placing "kdesu " in front of the command to play it as root did not change anything: sill no sound )-: Did I miss something in the explanation ? I modifyed the file copied past from kmail in vi running in a graphical terminal. There was caracters represented like "pipes". Changed them by spaces: no more problem. Then I can start the script with help of yast. But I still have no sound with ET, playing as user or as root. Thank you for the attention you paid to theset mails, Patrick