1

I want to execute two commands in the same line on Android terminal emulator.

Example: the two commands svc wifi disable and `exit

I want to create a widget to disable the WLAN and out of the terminal emulator app at the same time, and in the terminal emulator app widget, I can only put one command.

widget entry

  • svc wifi disable && exit – GiantTree Aug 9 '16 at 18:33
2

If you want to execute each command only if the previous one succeeded, then combine them using the && operator:

Your code should be as follows:

svc wifi disable && exit

It will work only if your first command successfully execute.

1

Like Andrew correctly said, with && you can combine them but you also can just add more than one command by ending each command by a ";", e.g. put into the arguments field (leave empty the command field):

svc wifi disable; exit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.