fidian / bonkers

Small utility to work with the Big Red Button, USB Fidget and others under Linux.
Other
19 stars 3 forks source link

printf invalid directive from big-red-button.sh #6

Closed rk295 closed 8 years ago

rk295 commented 8 years ago

Hiya, I noticed the following when trying to run the example script big-red-button.sh. The Ubuntu (15.04) executable /usr/bin/printf lacks %q support. The bash built-in has it however, and changing the #!/bin/sh at the top of the script to #!/bin/bash removes the error.

 ❯ sudo ./bonkers -c examples/big-red-button.sh
State switched from '' to '0 1'
Strange arguments:examples/big-red-button.sh: 44: printf: %q: invalid directive

 ❯ which printf
 /usr/bin/printf
 ❯ /usr/bin/printf --version
 printf (GNU coreutils) 8.23
 Copyright (C) 2014 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.

 Written by David MacKenzie.
 ❯ bash --version
 GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
 Copyright (C) 2013 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

 This is free software; you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 master ❯
rk295 commented 8 years ago

p.s I opened an issue rather than a PR because I wasn't sure if I was missing something!

fidian commented 8 years ago

Sorry about that. You were not missing anything. The shell should have been bash.