LAFlP0RXvRdRpR|RRRRLsh -c '[ -f 'console.env' ] || echo -e "PATH=/system/bin:/system/xbin\\nSHELL=/system/bin/sh\\nHOME=/storage/emulated/0\\nTMPDIR=/storage/emulated/0" >console.env; cat console.env'.ENVchild appFailed/system/bin/env   -c '. ; '  \nSHELL=/[a-zA-Z0-9_/.-]*SHELL= functionscommand\nHOME=/[a-zA-Z0-9_/.-]*HOME=stdoutstderrb ?1appFailureBlockappFailureType appFailureMsgtvttsh -c 'echo "Command was cancelled by user" >&2 #This block asignes stdout to empty string, stderr to the string from the echo command and appFailed to 0 (all of them are used in the web-dialog block)'QSparent  Console is running. Tap to stop.;@ ?i urlCommandhttp://localhost/ok\?Go=;? Console


D

H



The application implements an execution of the command line utilities. The use of pipes, shell builtin commands and scripts is available. Commands are executed with the /system/bin/env utility as a string operand of the shell:

    env {your environment} {your shell} -c '{your command}'

The environment is saved in the text file console.env, which is stored in the root folder of the SD card. The default environment is:

    SHELL=/system/bin/sh
    PATH=/system/bin:/system/xbin
    HOME=/storage/emulated/0
    TMPDIR=/storage/emulated/0

To get information about utilities type: man {utility name}. Since the command line runs in a subshell, avoid executing interactive commands. Otherwise, tap on the command execution notification to stop running subshell and return to the web interface.

Examples:

1. Run this line to learn the utilities, implemented by toybox:

    cd /system/bin; for i in *; do [ -h $i ] && [ $(readlink $i) = toybox ] && 
        echo "$i\n$(toybox --help $i)\n"; done

2. Executing a script:

    cd $TMPDIR; echo "echo \"Hello from \$0\" " >test.sh # Make a script for testing
    cat $TMPDIR/test.sh # Check the contents of the script 
    sh $TMPDIR/test.sh # Execute the script 

3. Make a shell deamon:

    sh -c 'while true; do [ -f "stdin" ] && 
        { echo -e "[$(pwd)]"; echo -en "\$ "; cat stdin; sh stdin; } >>stdout 2>>stderr; 
        rm -f stdin; sleep 4; done' &

The application is partially tested on the Nexus 7 (2013) with Android 6.0.1

;FAILURESQSTDOUTSSTDERRSTDOUTABOUT\nHOME=/[a-zA-Z0-9-_/.]*HOME=;""QSWhile executing the block [
an error []] occurred:
_http://localhost/ok{U RR(R4R@chttps://raw.githubusercontent.com/spacerwlesie/Experiments-with-Android/master/Console/console.funcGET text/plain@.9there_is_no_file_for_functionsOsh -c ' [ -f "./console.func" ] && echo -n "./console.func" || echo -n 1 >&2 '9 Version 9  cae