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   -   Original Discussion by shekhar_4_u
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 13 November 2017, 2:52 PM EST
Location: Loughborough
Posts: 1,224
Thanks: 367
Thanked 323 Times in 253 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   -   Original Discussion by shekhar_4_u
shekhar_4_u shekhar_4_u is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 7 July 2017, 5:31 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   -   Original Discussion by shekhar_4_u
cero cero is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 17 November 2017, 10:54 AM EST
Posts: 462
Thanks: 4
Thanked 101 Times in 93 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 09:02 AM..
    #11  
Old Unix and Linux 08-30-2013   -   Original Discussion by shekhar_4_u
wisecracker's Unix or Linux Image
wisecracker wisecracker is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 13 November 2017, 2:52 PM EST
Location: Loughborough
Posts: 1,224
Thanks: 367
Thanked 323 Times in 253 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   -   Original Discussion by shekhar_4_u
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   -   Original Discussion by shekhar_4_u
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 17 November 2017, 9:25 PM EST
Location: Saskatchewan
Posts: 22,512
Thanks: 1,151
Thanked 4,273 Times in 3,946 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   -   Original Discussion by shekhar_4_u
shekhar_4_u shekhar_4_u is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 7 July 2017, 5:31 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 01:02 AM
Example Linux Commands on Android Neo Android 0 09-27-2010 03:04 PM
Need help in sftp basic commands livetaurean19 Shell Programming and Scripting 2 06-15-2005 09:41 AM
basic commands documentation kdgorton UNIX for Dummies Questions & Answers 1 02-20-2005 04:19 AM
Unix basic commands Peter Spellman UNIX for Dummies Questions & Answers 3 08-10-2001 08:41 PM



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