MySQL Should Support the 'ls' Command

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

MySQL Should Support the 'ls' Command

Post by volomike »

How many of you are like me, you connect to MySQL at <*gasp*> command line, and you type 'ls' once you've selected your database, only to get the wrong result, and then remember, duh, oh yea, 'supposed to use 'show tables' instead?

Is there a way to hook mysql command such that when I type:

ls;

it does a 'show tables' for me?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: MySQL Should Support the 'ls' Command

Post by onion2k »

You can with MySQL Proxy and some LUA scripting... http://datacharmer.blogspot.com/2007/06 ... proxy.html

The script has moved to http://forge.mysql.com/tools/tool.php?id=76
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: MySQL Should Support the 'ls' Command

Post by Kieran Huggins »

You can code mysql functions in C as well... I've only added functions that were pre-written (levenshtein and the like), but you only need to do it once per server.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: MySQL Should Support the 'ls' Command

Post by Weirdan »

Kieran Huggins wrote:You can code mysql functions in C as well... I've only added functions that were pre-written (levenshtein and the like), but you only need to do it once per server.
Yeah, but those are only functions, and you need a statement here.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: MySQL Should Support the 'ls' Command

Post by Kieran Huggins »

Right you are!

Weirdan strikes again ;-)
Post Reply