adb shell is executed, the Android side also launches adb which then executes
/system/bin/sh -. This path is hard-coded in
347 #if ADB_HOST
348 #define SHELL_COMMAND "/bin/sh"
349 #define ALTERNATE_SHELL_COMMAND ""
351 #define SHELL_COMMAND "/system/bin/sh"
352 #define ALTERNATE_SHELL_COMMAND "/sbin/sh"
If you want to change this to bash, you will have to recompile it.
It is possible to execute some commands from file when running the interactive shell. As written in
sh - (note the
- for interactive mode) reads from the following files (in this order):
.profile (relative to current directory, this is
$ENV (environment variable
ENV should point to a file)
/ are read-only, the only way to get something loaded was by setting
ENV. You can probably create a symlink from
/data/profile by mounting
/ read-write (exercise for the reader).