View Single Post
Old 03-25-2013, 09:16 AM   #10
NullNix
Guru
NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.NullNix ought to be getting tired of karma fortunes by now.
 
Posts: 916
Karma: 13928438
Join Date: Jan 2013
Location: Ely, Cambridgeshire, UK
Device: Kindle Oasis 3, Kindle Oasis 1
Quote:
Originally Posted by twobob View Post
PHP Code:
# Now however you write a read command block:
read C
case $C in
  
'HOME' "$SETPROP com.lab126.appmgrd start app://com.lab126.booklet.home" ;;
  
'SCREEN SAVER' "$SETPROP com.lab126.appmgrd start app://com.lab126.booklet.settings?diagnosticMode=\;411" ;;
  * ) : 
# no-op ;
esac 


I have no idea why that doesn't work.
Well for one thing that ? is an unescaped shell metacharacter. It's probably not changing, due to matching nothing, but still, it's probably safer to say

PHP Code:
'SCREEN SAVER' "$SETPROP" 'com.lab126.appmgrd start app://com.lab126.booklet.settings?diagnosticMode=;411';; 
i.e. change quotation style after the command, since you no longer need parameter expansion after that point. Only, even that isn't what you want, because that's passing *one* parameter to setprop, which happens to have spaces in it. setprop isn't going to like that. Try

PHP Code:
'SCREEN SAVER' "$SETPROPcom.lab126.appmgrd start 'app://com.lab126.booklet.settings?diagnosticMode=;411';; 
Shell quoting... it has defeated all of us from time to time.
NullNix is offline   Reply With Quote