deweller / switchaudio-osx

Change the audio source for Mac OS X from the command line.
Other
1.16k stars 88 forks source link

Bug with Audio name containing "(" or ")" #16

Closed samleemc closed 5 years ago

samleemc commented 5 years ago

Hi There,

I would like to report a bug, the application give an bash error when the audio name contain any of the "(" or ")" or other symbol.

terminal log as below:

Sams-MacBook-Pro:~ sam$ switchaudiosource -a USB PnP Sound Device (input) CalDigit Thunderbolt 3 Audio (input) MacBook Pro Microphone (input) DisplayPort (output) CalDigit Thunderbolt 3 Audio (output) MacBook Pro Speakers (output) Sams-MacBook-Pro:~ sam$ switchaudiosource -c CalDigit Thunderbolt 3 Audio Sams-MacBook-Pro:~ sam$ switchaudiosource -t output -s CalDigit Thunderbolt 3 Audio (output) -bash: syntax error near unexpected token('`

zuckschwerdt commented 5 years ago

That's a bash: syntax error, nothing to do with our app. Use quoting

switchaudiosource -t output -s "CalDigit Thunderbolt 3 Audio (output)"
samleemc commented 5 years ago

nice! I didnt know we need to add the quote " "

Can you add this to the "help" so that we can make it obvious to other user?