From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13457 invoked from network); 20 Dec 2003 18:50:47 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 20 Dec 2003 18:50:47 -0000 Received: (qmail 27160 invoked by alias); 20 Dec 2003 18:50:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6934 Received: (qmail 27131 invoked from network); 20 Dec 2003 18:50:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 20 Dec 2003 18:50:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [80.91.224.249] by sunsite.dk (MessageWall 1.0.8) with SMTP; 20 Dec 2003 18:50:27 -0000 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AXmBH-0007k4-00 for ; Sat, 20 Dec 2003 19:50:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AXm1q-0007fY-00 for ; Sat, 20 Dec 2003 19:40:42 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AXm1q-0006Hb-00 for ; Sat, 20 Dec 2003 19:40:42 +0100 From: Lloyd Zusman Subject: Defining commands to not evaluate certain metacharacters Date: Sat, 20 Dec 2003 13:39:10 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux) Cancel-Lock: sha1:C37CN0pJUaY74rVMGzU/0arIM5c= Sender: news I want to define a set of commands that I can execute from the command line under zsh. These commands will be performing certain mathematical operations on their arguments, and therefore, I would like parentheses and possibly also square brackets to be passed to the command unchanged by the shell. However, I want to be able to use variable expansion. I would like to do this without quoting these parentheses (or square brackets, if I use them). For example, if CMD is one of the commands that I define and OP1, OP2, and OP3 are operations that CMD understands, I would like the following to take place: a=3 b=4 CMD (($a OP1 1) OP2 ($b OP3 2)) means: expand $a and $b on the command line, so that the intermediate result is this: CMD ((3 OP1 1) OP2 (4 OP3 2)) then, pass the string '((3 OP1 1) OP2 (4 OP3 2))' as the command line to CMD, which then interprets it as it pleases. I know that I can achieve this result by double-quoting the command line, as follows: CMD "(($a OP1 1) OP2 ($b OP3 2))" However, as I mentioned above, my goal is to avoid using quotes. Is there any way to set up aliases or something similar under zsh so that I can define commands that will function like my CMD example? Thanks in advance. -- Lloyd Zusman ljz@asfast.com