[Epic 4G Android Development] SenseiSimple:
Android Shell Environment - Bash 4.1

Package Version 1.2b - 01/06/2012

DOWNLOAD MOD_CWM-UltimateAndroidShell-Bash4.1-20120107.zip

File size: 5.3 MB / MD5 84cb672cd11b7a3e9b21e29c3416da21

​

DETAILS

This package is an amalgamation from various sources including my own to create the perfect shell environment for Local and Remote administration.

All solutions so far have been incomplete or require more configuration to get working, so i thought i would share what i've been running.

This package installs Bash and the other listed features and sets bash as the default shell.

Hope it's useful!

INCLUDED BINARIES

- Bash 4.1

- BusyBox 1.19.0

- Htop

- 7z (p7zip v9.20)

- bc

- Nano

- Joe

- Vim

- SSH/Dropbear

- SCP

- Rsync

- Curl

Android Terminal v1.0.39 - /system/Term.apk - com.senseisimple.androidterm

Custom Built Terminal based on Terminal Emulator by Jackpal

[Source on Github]

INCLUDED SCRIPTS

[sudo] Pseudo sudo, run a command as Root

Usage: sudo [command]

[reboot] BML/MTD Compatible reboot wrapper with recovery boot

Usage: sudo reboot [recovery]

[adbwifi] Easily enable/disable ADB over Wifi (persistent until reboot or disable) without an app/widget (su required or use with sudo)

Usage: sudo adbwifi [on | off | status]

[remount] Remount the /system partition as ReadOnly or Read/Write (su required)

Usage: sudo remount [ro | rw | status]

[defaultshell] Change default shell on the fly from Bash to sh (this is a persistent change)

Usage: sudo defaultshell [sh | bash | current]

[sdcardstuck] Media Provider Fix

If your phone is running warm and laggy and eating battery after a clean install,

it's possible "android.process.media", the Media Scanner process,

is stuck on a file it's unable to read on the sdcard causing it to hang indefinitely.

The script tests for stuck files, and offers to delete them or generate a list,

also cleans the Media Provider database.

Usage: sudo sdcardstuck

CUSTOM BASH ENVIRONMENT

Home (~) at /data/local

$ prompt as User

# prompt as Root

Preset shopt options

histappend, histverify, histreedit, cdspell, expand_aliases, cmdhist

hostcomplete, no_empty_cmd_completion, nocaseglob, dotglob, autocd

Bash/Su files

- /etc/profile

- /etc/bash_bashrc

- /etc/terminfo

- /etc/passwd

- /system/etc/init.d/00bashinit - for kernel compatibility if using bash as default shell (sets up/fixes the bash environment on boot)

- /data/local/.inputrc

- /data/local/.profile

- /data/local/.bashrc

- /data/local/.bashrc_support

- /data/local/.bashrc_user <- Edit this file to add shell functionality (loads last)

- /data/local/.bash_history

- /data/local/tmp

- /data/local/bin

- /data/local/sbin

- /data/local/xbin

ENVIRONMENT VARIABLES

PATH = /data/local/xbin:/data/local/bin:/data/local/sbin:/system/bin:/system/xbin:/sbin:/data/local/tmp

EDITOR = nano - default editor (used by edit/e/suedit aliases, set with seteditor)

VISUAL = $EDITOR

TERMINFO = /system/etc/terminfo

TERM = Linux

HISTCONTROL = ignoredups:ignorespace

AVAILABLE FUNCTIONS

motd - clear the screen, display the MOTD

Usage: motd

hist - search command history

Usage: hist [part of command]

pg - search processes

Usage: pg [running process name]

pid - get process id

Usage: pid [running process name]

appuid - get uid of running process

Usage: appuid [running process name]

bg - run process in the background

Usage: bg [command]

quiet - run process quietly

Usage: quiet [command]

ip - get active ip address

Usage: ip

seteditor - set default text editor availability by order of preference

Usage: seteditor [space separated bins | default]

Example (defaults): seteditor nano vim vi

AVAILABLE ALIASES

bb - Busybox (/sbin/busybox)

su - Su (Bash compatible)

ls - ls w/ color

l - ls -CF w/ color

la - ls -a w/ color

li - ls -laniF w/ color

ll - ls -alF w/ color

lsn - ls -lanF w/ color

dir - ls -halF

edit or e - Shortcut to your favorite editor by order of preference/availability (default: nano vim vi)

suedit - run editor as Root

HUMBLE GRATITUDE

Nubecoder for the bash 4.1 bin that makes this possible http://http://xdaforums.com/showthread.php?t=1225296

bc54 for additional ideas, remount/default shell scripts http://xdaforums.com/showthread.php?t=1229211

Jocala for the pointer to nano and joe and info in his post http://xdaforums.com/showthread.php?t=1349454

Toadlife MTD help

Bbelos MTD help