>_ Console

by vitalizzare

Version 8 (February 8, 2019)

Download (120 downloads)

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 {environment} {shell} -c '{command}'

The environment is saved in a file console.env in the root folder of the SD card. The default environment is set to:

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}. Type man without operands to get information about this function. 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.

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

EXAMPLES

Example 1
Run this line to learn the utilities, implemented by toybox:
    cd /system/bin; for i in *; do [ -h $i ] && [ $(readlink $i) = toybox ] &&
        echo -e "$i\n$(toybox --help $i)\n"; done

Example 2
Make a shell daemon:
    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' &
Now you can stop the flow and use the daemon to run shell commands. Send commands to the file stdin and get output in files stdout and stderr.

CHANGES

Version 8 (22 blocks)
1. The function man has been fixed and updated.
2. Functions are downloaded from https://raw.githubusercontent.com/vitalizzare/Android_Automate/master/console.func

Version 7 (24 blocks)
1. Function man is fixed.
2. Interface is improved.
3. Added the ability to stop hung commands.

Version 6 (19 blocks)
1. Added function man.
2. Displaying of a standard output is separated from app failures.

Version 5 (21 blocks)
1. The environment is saved in a file.

Version 4 (26 blocks)
1. Fixed bugs.

Version 3 (30 blocks)
1. Added manipulations with the environment.

Version 2 (14 blocks)
1. The Web-Dialogue is used instead of the Confirme-Dialogue.
2. The mksh manual added instead of the POSIX man sh.

Version 1 (7 blocks)
1. sh -c 'command' is used to execute commands.
2. Type help to get the POSIX man sh.

Based on:
http://llamalab.com/automate/community/flows/9406
http://llamalab.com/automate/community/flows/26999
http://llamalab.com/automate/community/flows/4091
http://llamalab.com/automate/community/flows/22425

https://www.w3schools.com/howto/howto_js_tabs.asp
https://www.all-things-android.com/content/android-toolbox-command-reference
https://android.googlesource.com/platform/system/core/+/android-6.0.1_r81/toolbox/

Tags: terminal, shell, console, CLI

4.0 average rating from 2 reviews

5 stars
1
4 stars
0
3 stars
1
2 stars
0
1 star
0
Warnings
0

Reviews and ratings can be submitted in the app.