Bug 341640 - kmixremote fails when using dash as /bin/sh
Summary: kmixremote fails when using dash as /bin/sh
Status: RESOLVED FIXED
Alias: None
Product: kmix
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Christian Esken
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-07 19:06 UTC by Jim Scadden
Modified: 2015-01-06 22:35 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
kmixremote-dash-compatibility.patch (1.53 KB, patch)
2014-12-07 19:10 UTC, Jim Scadden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Scadden 2014-12-07 19:06:52 UTC
The kmixremote script contains bash specific commands however the shebang uses /bin/sh as an interpreter which does not necessarily mean that bash will be used to run the command.

Debian/Ubuntu use dash instead of bash to provide /bin/sh and as a result the script produces errors and does not function as intended.

Reproducible: Always

Steps to Reproduce:
Run kmixremote

Actual Results:  
$ kmixremote list
/usr/bin/kmixremote: 10: /usr/bin/kmixremote: function: not found
Usage:
List mixers    #   /usr/bin/kmixremote list
List controls  #   /usr/bin/kmixremote list <mixer>
Get Volume     #   /usr/bin/kmixremote get  [--master | <mixer> <control>]
Set Volume     #   /usr/bin/kmixremote set  [--master | <mixer> <control>] 
<0..100>
Mute/Unmute    #   /usr/bin/kmixremote mute [--master | <mixer> <control>] 
true|false

/usr/bin/kmixremote: 21: /usr/bin/kmixremote: function: not found
Error: list

/usr/bin/kmixremote: 25: /usr/bin/kmixremote: usage: not found

Expected Results:  
$ kmixremote list
PulseAudio__Playback_Devices_1
PulseAudio__Capture_Devices_1
PulseAudio__Playback_Streams_1
PulseAudio__Capture_Streams_1

The attached patch allows kmixremote to work correctly with either bash or dash as /bin/sh
Comment 1 Jim Scadden 2014-12-07 19:10:23 UTC
Created attachment 89863 [details]
kmixremote-dash-compatibility.patch
Comment 2 Christian Esken 2015-01-06 22:34:50 UTC
Git commit bc607e91429c9d49b3f2c52648f869c89ef81387 by Christian Esken.
Committed on 06/01/2015 at 22:34.
Pushed by esken into branch 'master'.

Make kmixremote sh compatible.

M  +9    -8    apps/kmixremote

http://commits.kde.org/kmix/bc607e91429c9d49b3f2c52648f869c89ef81387
Comment 3 Christian Esken 2015-01-06 22:35:54 UTC
I commited it to trunk. Thanks for the patch, Jim. :-)