Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Phones > HTC EVO 4G > EVO 4G - All Things Root

EVO 4G - All Things Root Rooting, ROMS, Overclocking, etc.



Reply
 
LinkBack Thread Tools
Old July 16th, 2010, 05:41 PM   #1 (permalink)
Member
 
Join Date: Feb 2010
Posts: 208
 
Device(s): HTC Hero, Samsung Moment, HTC EVO
Thanks: 11
Thanked 120 Times in 48 Posts
Default [GUIDE] Full bash shell with nano, tab completion, and color over ssh

I cobbled all of this together from various places on the web, but I think the credit for the binaries goes to Paul @ MoDaCo.

Nandroid before going any further!

Files you'll need:

QuickSSHD (Download this from the Market. $1.50). I'm just going to assume if you're still reading, you know what this is for and how to use it. It's braindead simple. I think dropbear can be installed and configured manually, but for the $1.50...meh.

The rest are zipped up here: terminfo.zip, nano, bash, profile**

Unzip bashnano.zip onto your SDCard.

From adb shell:

Install Terminfo:
cp -r /sdcard/terminfo /system/etc

Setup Bash:
cp /sdcard/bash /system/bin/bash_new
mv /system/bin/sh /system/bin/sh.old
ln -s /system/bin/bash_new /system/bin/sh
cp /sdcard/profile /etc

Setup Nano:
cp /sdcard/nano /system/bin


I'm not sure if this setup will have any impact on sh scripts being used in the various ROMs, so use this at your own risk.

This will give you full bash over adb, but I haven't figured out where profile goes to add terminal/color et al. for adb.

Anyway, hope y'all find it useful.

**profile reflects a few personal choices for aliases and colors, but you can edit to your personal taste.

__________________
EVO 4g CM6 RC1/cm6-snap!
The EVO is GIMPED by HTC - Why must XDA devs do for HTC what HTC should have done for you?
jmxp69 is offline  
Reply With Quote
The Following User Says Thank You to jmxp69 For This Useful Post:
ninadchaudhari (May 17th, 2012)
Sponsors
Old September 1st, 2010, 03:33 PM   #2 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Very awesome! I only wish this was in apk package form lol
But perhaps that isn't possible because of permissions.


I didn't need QuickSSHD. Any regular terminal should work, and many are $0 free on the market. I recommend "Terminal Emulator" or "ConnectBot".

Also, a few steps that appear to be missing:
1. Before attempting to write to /system/bin, you need to remount it as writable
./adb remount (through USB)
OR
mount -o rw,remount /dev/block/mtdblock1 /system (as root on terminal)
2. chmod 755 /system/bin/bash_new (make it executable)
3. chmod 755 /system/bin/nano (make it executable)


These programs work on my rooted motorola cliq, with a few exceptions. I actually had to store the files (bash and nano) in /data/ (mtdblock2), and symlink to them from /system/bin, because there wasn't enough free space on the root partition.

My steps were similar to this:
1. Through USB run ./adb remount
2. Login to android terminal as root (Terminal Emulator)
3. Run these commands
cp /sdcard/bashnano/profile /etc
cp /sdcard/bashnano/bash /data
cp /sdcard/bashnano/nano /data
chmod 755 /data/bash
chmod 755 /data/nano
cd /system/bin/
mv sh sh.old
ln -s /data/bash sh
ln -s /data/bash bash
ln -s /data/nano nano


Using BASH special keys:
Control (Ctrl) key = Wheel button
Escape key (esc) = Ctrl + 1 + 2 (comes in handy big time if using vi)
Go to beginning of line = Ctrl +a
Go to end of line = Ctrl + e
Tab completion = Ctrl + i
The commandline redirection ">" = Shift + Alt + l
The commandline redirection "<" = Shift + Alt + k
The pipe character "|" = Shift + Alt + a
Cut = Ctrl + w
Paste = Ctrl + y
Reverse search previous commands = Ctrl + r
Break reverse search = Ctrl + g
Reverse slash "\" = Ctrl + Shift + n
Carrot key "^" = Ctrl + Shift + j

Anyone Please write in if you know how to input any other special characters, such as "~" or "[" or "]".


I recommend Remounting your /system read-write and downloading BUSYBOX from the market Before installing bashnano. Backup your system.
Sepero is offline  
Last edited by Sepero; October 14th, 2010 at 08:58 AM. Reason: m
Reply With Quote
The Following User Says Thank You to Sepero For This Useful Post:
ninadchaudhari (May 17th, 2012)
Old September 1st, 2010, 04:10 PM   #3 (permalink)
Senior Member
 
cabbie's Avatar
 
Join Date: Mar 2010
Posts: 1,342
 
Device(s): HTC Hero, HTC EVO4G
Thanks: 89
Thanked 515 Times in 120 Posts
Default

yea...i feel dumb. what is the objective of all this?
__________________
NOOB guide: What ROOTING is in laymans terms
Tablet: B&N NookColor
Phone Carrier: Sprint ~~ Phone: HTC EVO 4G ~~ Android: 2.2 (Froyo) ~~ Software #: 3.70.651.1 ~~ ROM: FreshEvo 3.5.0.1 ~~ Kernel: One of the various SBC ones ~~ Baseband: 2.15.00.11.19 ~~ PRI 1.90_003 ~~ PRL: 60672
cabbie is offline  
Reply With Quote
Old September 1st, 2010, 04:18 PM   #4 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bash shell does not appear to be recognizing the file /etc/profile

Not 100% sure
Sepero is offline  
Reply With Quote
Old September 1st, 2010, 04:27 PM   #5 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by cabbie View Post
yea...i feel dumb. what is the objective of all this?
The objective is to install the Bash shell and Nano text editor. These are for use in the commandline/terminal.
Sepero is offline  
Reply With Quote
Old September 1st, 2010, 04:43 PM   #6 (permalink)
Junior Member
 
Join Date: Aug 2010
Posts: 82
 
Device(s): Supersonic EVO 4G
Thanks: 3
Thanked 6 Times in 6 Posts
Default

Quote:
Originally Posted by Sepero View Post
The objective is to install the Bash shell and Nano text editor. These are for use in the commandline/terminal.
Exactly what is this gonna let us do on/to our phones?
Hazy is offline  
Reply With Quote
Old September 1st, 2010, 06:27 PM   #7 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by Hazy View Post
Exactly what is this gonna let us do on/to our phones?
ROOT?
I just realized that jmxp69 did not state that the phone needs to be rooted before you can install these programs. I'm pretty sure that your phone must be ROOTED first.

I use Ubuntu Linux as my desktop operating system. On my desktop, I use the bash shell almost everyday. With the Bash shell, I can perform operations that are impossible with graphical programs (such as batch operations, appending to files, changing owners/groups/permissions, remounting/reformating file system, automated/timed/looped scripts, much more).

Nano is a popular text editor that runs in the terminal. It is useful for simply editing text files or creating bash scripts.
Sepero is offline  
Reply With Quote
Old September 1st, 2010, 07:27 PM   #8 (permalink)
Member
 
Join Date: Jun 2010
Posts: 380
 
Device(s):
Thanks: 57
Thanked 78 Times in 47 Posts
Default

Quote:
Originally Posted by Hazy View Post
Exactly what is this gonna let us do on/to our phones?
Nothing for the every day user.

It is a different story if you are a Dev or are familiar with command line stuff.
laredo7mm is offline  
Reply With Quote
Old October 14th, 2010, 02:16 AM   #9 (permalink)
New Member
 
Join Date: Oct 2010
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default My Modification Diffs

THANKS FOR THE NICE INFO!!

I didnt rename bash
I put profile in /system/etc
created /system/etc/shells with /system/bin/bash
and sshd uses bash automatically

wasnt too crazy renaming /system/bin/sh...
StuartRothrock is offline  
Reply With Quote
Old May 11th, 2011, 02:52 PM   #10 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Uploading another copy of the zip file incase the original server ever goes down.
Attached Files
File Type: zip bashnano.zip (1.52 MB, 13 views)
Sepero is offline  
Reply With Quote
Sponsors
Old May 11th, 2011, 03:16 PM   #11 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 8
 
Device(s):
Thanks: 0
Thanked 1 Time in 1 Post
Default

Also there is a free editor and screen keyboard on the market named "touchqode" that is very useful for typing in programming/scripting code and special characters. java php perl python c++ etc

It supports ftp, file syncing, syntax highlighting and more.

market://details?id=com.touchqode.editor
http://www.touchqode.com

Sepero is offline  
Reply With Quote
Reply

HTC EVO 4G
Current Rating:
Rate this Phone:

When Sprint announced their first ever 4G handset at CTIA in March 2010, they dropped a bombshell on the mobile world. The HTC Evo 4G is a device that introduces a lot of firsts when compared to other North American handsets. This is the first Andr... Read More


Bookmarks


Go Back   Android Forums > Android Phones > HTC EVO 4G > EVO 4G - All Things Root User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HOWTO] Remove bash Color Codes adrynalyne Fascinate - All Things Root 3 January 6th, 2011 01:50 PM
this isn't another iphone bash, it's a people bash 150_cav The Lounge 109 April 13th, 2010 12:01 PM



All times are GMT -5. The time now is 06:28 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo