Questions tagged [mksh]

MirBSD Korn shell, or mksh, is a Free command interpreter (shell) intended for both interactive and shell script use. On Android 4 and newer, Android-x86 2.2 and newer, and some other variants, mksh is the system shell; older systems used ash, some older aftermarket firmwares used busybox sh. Please only add the mksh tag if the question relates to mksh.

Filter by
Sorted by
Tagged with
1 vote
1 answer

Difference between adb shell [command] and interactive adb shell

I am wondering if the interactive shell adb shell runs in a different context then when invoking a command via adb shell [command]? The background to this question is, that I am running dinit on an ...
stylesuxx's user avatar
  • 131
2 votes
1 answer

How to use multibyte file names in adb shell?

I have a Galaxy S6 running Android 7.0: zeroflte:/ $ getprop 7.0 There exists a file which uses the Unicode codepoint U+1F308 (RAINBOW) in its ...
Michael Albinus's user avatar
4 votes
1 answer

Update mksh to latest version

Android ships with mksh as shell, how can I upgrade to latest version (now R57, mine still on R43)? Official site offers to compile from source, anyone building ready ...
Ju Tutt's user avatar
  • 514
1 vote
3 answers

Lengthy sleep command not working in script

I've written a su.d script to periodically (every 4 hours) back up data from an app using a looped sleep command: #!/system/bin/sh ( # Wait for boot to complete until [ "$(getprop sys....
andronoid's user avatar
1 vote
1 answer

How to Check if Script is run once device is booted?

I have a script I need to run once, and only once the phone is booted. I have attempted,, debuggerd, and finally mkshrc While my script ran with debuggerd, I ...
Kevin's user avatar
  • 209
5 votes
3 answers

How to write android shell history to file

Using Terminal Emulator for Android, is there a way to enable a persistent command history? So far, I've tried the following: initial command of export HISTFILE=$HOME/.mksh_history user mksh profile ...
Six's user avatar
  • 330
3 votes
1 answer

Shell .profile or /etc/profile for old android 2.3.3

Just rooted my old phone with Android 2.3.3 and I would like to define some aliases for each shell I start (with adb or terminal app). I found this question where one answer says that /etc/profile (=/...
Harald's user avatar
  • 257
3 votes
3 answers

Work-around for process substitution in mksh

An extremely useful feature of Bash, known as process substitution, is missing in the Android shell, mksh. This is highly unfortunate as it prevent you from doing things like: diff <(sort list1) &...
not2qubit's user avatar
  • 847
6 votes
3 answers

Can I update the adb shell's environment variables?

I wanted to update the PATH environment variable permanently in the adb shell. I guessed the shell was mksh for I've found /system/bin/sh pointing to /system/bin/mksh. Then I tried Making a new file /...
Shawn Xie's user avatar
  • 161
0 votes
1 answer

unexpected root request for mksh when turning wifi on or off

Since today, I see the following root warning when turning wifi on or off: Superuser Anfrage / Superuser request: mksh (1000) Angeforderter Benutzer / Requested User: ROOT (0) Befehl / Command: ip ...
Daniel Alder's user avatar