I am using android sqlite3 command line tool. How do I repeat the last command that I executed (similar to the / in sqlplus)? Tried up arrow and . - both didnt work. I am on Mac :(
3 Answers
I now fall into the same problem.
When I type up, it prints ^[[A.
when I type left, it prints ^[[D. And it is similar to down and right
And I found this question( Sqlite using command line) and solove it.
First, rename the sqlite3 to sqlite3_bak in android tools to make it disable, or you can directly remove it, if you can make sure you will not use it again.
Second, download the "autoconf" source from http://www.sqlite.org/download.html (second link, currently to http://www.sqlite.org/sqlite-autoconf-3071502.tar.gz ):
then cd to the decompressed directory and compile it via the terminal
$ ./configure
$ make
$ sudo make install
Third, put your "new sqlite3 binary" to /opt/local/bin directory or set a soft-link to this file. And source your .bash_profile or .bashrc.
2 Comments
FYI - on my Raspberry Pi 3, not logged in as admin.
Go to https://github.com/robdelacruz/compile-sqlite3 and download the .zip file.
$ unzip ~/Downloads/compile-sqlite3-master.zip
$ cd ~/compile-sqlite3-master
$ sudo apt install libreadline-dev libncurses-dev
$ make clean
$ make all
$ make install
$ sqlite3
You should be good to go, but if not then check that you're not still running the old executable.
$ whereis sqlite3
sqlite3: /usr/bin/sqlite3 /usr/local/bin/sqlite3
$ ls -l /usr/bin/sqlite3
-rwxr-xr-x 1 root root 1382624 Mar 11 19:33 /usr/bin/sqlite3
$ ls -l /usr/local/bin/sqlite3
-rwxr-xr-x 1 root staff 4845796 Feb 18 20:23 /usr/local/bin/sqlite3
If you are still running the old exe then copy the new exe over the old exe or amend your search path so, when you type sqlite3 at the command prompt, the new exe is the one you run. I did the former.
$ sudo cp /usr/bin/sqlite3 /usr/local/bin/sqlite3
This worked for me.
Comments
I might have just imagined it and I can't check just now but can you not just press the up arrow key?