Skip to main content

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
566 views

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
362 views

How to use multibyte file names in adb shell?

I have a Galaxy S6 running Android 7.0: zeroflte:/ $ getprop ro.build.version.release 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
767 views

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 https://www.mirbsd.org/mksh.htm offers to compile from source, anyone building ready ...
Ju Tutt's user avatar
  • 514
1 vote
3 answers
2k views

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
845 views

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 init.qcom.post_boot.sh, init.sec.boot.sh, debuggerd, and finally mkshrc While my script ran with debuggerd, I ...
Kevin's user avatar
  • 209
6 votes
4 answers
3k views

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
  • 350
3 votes
1 answer
1k views

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
1k views

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
13k views

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
1k views

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