[SunRay-Users] SRSS and pulseaudio on Linux - ksh shell needed

Bob Doolittle Robert.Doolittle at Sun.COM
Mon Nov 2 13:51:59 EET 2009


Stewart Walters wrote:
> Andreas von Heydwolff wrote:
>> Dear listmembers,
>>
>> installing SRSS 4.2EA on my Debian server I realized that using 
>> http://wiki.sun-rays.org/images/f/f5/95SUNW-pulseaudio.txt or similar 
>> scripts requires installing ksh and a line on top of the script that 
>> is to be put in /etc/X11/Xsessions.d/ as follows:
>>
>>   #!/usr/bin/ksh
>>
>> Otherwise
>>
>> # sed "s|UTAUDIODEV|$UTAUDIODEV|g" /usr/local/bin/utpulse.pa > 
>> ${PULSECONF}
>>
>> will not work because the default bash shell throws an error message 
>> and does not insert the current variable; using slashes instead of 
>> the pipe  signs results in bash only in a literally inserted 
>> $UTAUDIODEV.
>>
>> Cost me an hour or two to figure it out, perhaps this could be 
>> updated in the respective Wikis. With ksh the script works very well.
>>
>> Greetings,
>>
>> --AvH
>> _______________________________________________
>> SunRay-Users mailing list
>> SunRay-Users at filibeto.org
>> http://www.filibeto.org/mailman/listinfo/sunray-users
>
> I think from memory the last time I did an install of Sun Ray on 
> Debian (SRSS 4.1 on Stable/Lenny), the installation script for SRSS 
> aborted unless I already had ksh installed in the first place (it does 
> a check).
>
> Is that possible why it's never had a shebang added to the first line 
> of that script?

Those scripts do say "#!/bin/sh" at the start. The point was to use the 
least-common-denominator shell, and that's typically /bin/sh. Bourne 
shell and ksh both expand variables in double-quotes. So does bash:

bash-3.00$ A=foo
bash-3.00$ echo foobar | sed "s/$A/blech/"
blechbar
bash-3.00$ echo foobar | sed "s|$A|blech|"
blechbar

As you can see above, pipes or slashes are used shouldn't matter - sed 
will use whatever the character that follows the 's' in its substitution 
command, and it doesn't appear that bash does anything strange with '|' 
in double-quotes. Maybe you have a new version of bash that is now 
handling '|' or variable-expansion in double-quotes differently? Maybe 
this is a bug in your Debian release?

-Bob



More information about the SunRay-Users mailing list