>_ Console

by vitalizzare

Version 10 (July 6, 2019)

Download (187 downloads)

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

    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 useful for checking command lines before using them in a Shell command block.

Tested on Nexus 7 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 read output in stdout and stderr.

CHANGES

Version 10 (16 blocks)
If there's a file console.func on a local storage, its version on github will not be downloaded.

Version 9 (14 blocks)
Everything except the terminal itself has been removed. To change the environment - change the file console.env manually.

Version 8 (22 blocks)
Functions are stored at github.

Version 7 (24 blocks)
Added the ability to stop hung commands.

Version 6 (19 blocks)
1. Added function man.
2. Output of stdout is separated from stderr and app failures.

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

Version 4 (26 blocks)

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

Version 2 (14 blocks)
1. The 'Web Dialogue' is used instead of the 'Confirme'.
2. The mksh manual added as a response to 'man sh'.

Version 1 (7 blocks)

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

4.3 average rating from 3 reviews

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

Reviews and ratings can be submitted in the app.