To much quotes (") awk -F "\"" '/at/ {print $}' instead of awk -F "\"" "'/at/ {print $}' Code: #!/bin/sh if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" ]; then if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:false | echo "" else if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" fi
#!/bin/sh if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" ]; then if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:false | echo "" else if [ dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.manager.ListAdapter | awk -F "\"" '/at/ {print $}') org.bluez.Adapter.SetProperty String: Powerd variant:boolean:true | echo "" fi