Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

noquote for quotes as in noglob for filename generation?



Hello list,

Is there an equivalent 'noquote' for quotes (as in noglob for filename
generation)?

What I'm trying todo:

I have a shell script named 'sql':
that does pretty much this:

	$ cat ~/bin/sql
	<uninteresting details omitted...>
	sql_command=`noglob echo "$@"`      # Note the noglob!
	eval mysql -u $username -p$password $db "\"$sql\""

And in my .zshrc:

	alias select='sql select'
	alias insert='sql insert'
	alias update='sql update'

This allows me to run sql queries directly from zsh command line prompt without
directly invoking mysql.  The advantage is obvious: I can run sql commands
directly from zsh prompt, which gives me all the bells and whistles of command
line processing that comes with zsh (honorary mention: the _programmable_
completion).

The 'noglob' above allows me to do

	$ select * from Artist

instead of

	$ select \* from Artist

Now I want to be able to do

	$ select * from Artist where name like '%Jackson'

instead of

	$ select * from Artist where name like \'%Jackson\'

Is there an easy solution (like noglob) that I can use here?

Thanks in advance for any pointers and help.

Nazri.



Messages sorted by: Reverse Date, Date, Thread, Author