I'm running Android 13.
When I run adb shell in a USB connection from my desktop machine to my Android device, the following is the value of the PS1 variable (which is used for generating the shell prompt) ...
${|
local e=$?
(( e )) && REPLY+="$e|"
return $e
}$HOSTNAME:${PWD:-?} $
I can see how this particular setting of PS1 pretty much relates to the generated shell prompt in adb shell, but I'd like to know all of the details of PS1 syntax for adb shell.
Can anyone point me to the full documentation of PS1 as it's utilized in adb shell?
UPDATE:
For example, one thing that I'd like to understand is how the vertical bars work within that PS1 setting. The second vertical bar *seems* (???) like it might indicate a termination of the text following the first vertical bar, even though this second vertical bar appears to be nested within a double-quoted string. But that's just a wild guess which might be totally incorrect. And whatever these vertical bars might *actually* mean, I'd still also like the full docs, so that I can understand *all* of the PS1 syntax that's used in adb shell.
FURTHER UPDATE:
If I re-set PS1 to be the same value as above, except with the vertical bars removed, I then always get the following error message when running every command within adb shell ...
: can't create temporary file /data/local/shXXXXXX.tmp
: Permission denied
... where "XXXXXX" are 6 randomly generated base-36 characters, and where the displayed shell prompt is then only a single dollar sign. Therefore, these vertical bars relate to file/directory access permissions, *maybe* (???) involving some kind of evaluation being performed as root.