Unix/Linux Go Back    


Android Brand new forum for folks interesting in Linux and Java-based Android OS and multi-platform mobile computing in general.

Basic commands for android!!

Android


Closed    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 08-30-2013
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 29 March 2017, 5:32 AM EDT
Location: Loughborough
Posts: 1,176
Thanks: 353
Thanked 312 Times in 242 Posts
You might be limited to /bin/ed instead...

Good kuck...

For "printf" use "echo -e -n" instead, but I suspect you already know that... ;o)
The Following User Says Thank You to wisecracker For This Useful Post:
shekhar_4_u (08-30-2013)
Sponsored Links
    #9  
Old Unix and Linux 08-30-2013
shekhar_4_u shekhar_4_u is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 11 May 2016, 4:45 AM EDT
Location: INDIA (delhi)
Posts: 57
Thanks: 34
Thanked 2 Times in 2 Posts
Thanks Wisecracker!!

echo -e -n "\033[2J" cleared the screen but it didn't take the cursor to top left.

echo -e -n "\x1B[2J\x1B[1;1f" did not work for me.

/bin/ed - I treid earlier also but it did not work.
Sponsored Links
    #10  
Old Unix and Linux 08-30-2013
cero cero is online now
Registered User
 
Join Date: Aug 2006
Last Activity: 30 March 2017, 8:40 AM EDT
Posts: 450
Thanks: 4
Thanked 98 Times in 90 Posts
To create a file you may abuse cat but it does not offer any editor functionality (cursormovment,...). Without a file as argument cat takes stdin as source.
Redirect its output to the new file.

Code:
cat >new_file_name

Edit: When you are finished typing your text press <ctrl>+d or <ctrl>+c to stop.

Last edited by cero; 08-30-2013 at 08:02 AM..
    #11  
Old Unix and Linux 08-30-2013
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 29 March 2017, 5:32 AM EDT
Location: Loughborough
Posts: 1,176
Thanks: 353
Thanked 312 Times in 242 Posts
Try:-

Code:
echo -e -n "\x1B[2J\x1B[1;1H"

Maybe you terminal does not recognise "f"...

As for the editor I am at a loss except write your code on another *NIX like machine and use your email to obtain it is an attachment to an email...
Sponsored Links
    #12  
Old Unix and Linux 08-30-2013
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 976 Times in 790 Posts
Quote:
Originally Posted by shekhar_4_u View Post
I am not able to even use 'vi'
I believe Busybox is available for Android. If so, that's probably an easy way to fill in most missing utilities.

Regards,
Alister

---------- Post updated at 10:47 AM ---------- Previous update was at 10:40 AM ----------

Regarding clear, that's usually a hardlink to, or a script which calls, tput. In the Linux world, those tools are part of ncurses. I would be surprised if it isn't also available for Android, since a lot of tools depend on it.

Regards,
Alister
Sponsored Links
    #13  
Old Unix and Linux 08-30-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 28 March 2017, 4:17 PM EDT
Location: Saskatchewan
Posts: 22,020
Thanks: 1,065
Thanked 4,130 Times in 3,822 Posts
One of the first things many do with a rooted phone is install sshd so they can login with any ssh client and get a real shell (edited by neo)
Sponsored Links
    #14  
Old Unix and Linux 09-02-2013
shekhar_4_u shekhar_4_u is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 11 May 2016, 4:45 AM EDT
Location: INDIA (delhi)
Posts: 57
Thanks: 34
Thanked 2 Times in 2 Posts
cat > file_name worked for me. I am surprised why I did not try it earlier. Thanks Cero. Linux

saved echo -e -n "\033[2J" in my /system/bin file as 'clear'. Its working now but same problem remains. Cursor doesn't go to top left of the screen.

Wisecracker : echo -e -n "\x1B[2J\x1B[1;1H" did not work either.Linux
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Noob scripting question with android ADB commands Onyoursix UNIX for Dummies Questions & Answers 2 10-21-2011 12:02 AM
Example Linux Commands on Android Neo Android 0 09-27-2010 02:04 PM
Need help in sftp basic commands livetaurean19 Shell Programming and Scripting 2 06-15-2005 08:41 AM
basic commands documentation kdgorton UNIX for Dummies Questions & Answers 1 02-20-2005 03:19 AM
Unix basic commands Peter Spellman UNIX for Dummies Questions & Answers 3 08-10-2001 07:41 PM



All times are GMT -4. The time now is 08:49 AM.