From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13162 invoked from network); 20 Mar 2005 20:09:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Mar 2005 20:09:22 -0000 Received: (qmail 13399 invoked from network); 20 Mar 2005 20:09:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Mar 2005 20:09:16 -0000 Received: (qmail 12645 invoked by alias); 20 Mar 2005 20:09:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8614 Received: (qmail 12632 invoked from network); 20 Mar 2005 20:09:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 Mar 2005 20:09:08 -0000 Received: (qmail 12518 invoked from network); 20 Mar 2005 20:09:08 -0000 Received: from unknown (HELO pepper.fruitcom.com) (213.201.177.249) by a.mx.sunsite.dk with SMTP; 20 Mar 2005 20:09:04 -0000 Received: from localhost (pepper [127.0.0.1]) by pepper.fruitcom.com (Postfix) with ESMTP id 3C35B6A06D; Sun, 20 Mar 2005 21:09:04 +0100 (CET) Received: from pepper.fruitcom.com ([127.0.0.1]) by localhost (pepper [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13021-02; Sun, 20 Mar 2005 21:09:00 +0100 (CET) Received: by pepper.fruitcom.com (Postfix, from userid 1000) id A97A96A06E; Sun, 20 Mar 2005 21:09:00 +0100 (CET) Date: Sun, 20 Mar 2005 21:09:00 +0100 From: Eric Smith - Fruitcom To: Zsh Users Subject: Re: defining real time variables for a shell Message-ID: <20050320200900.GD26316@fruitcom.com> References: <20050320170559.GA30366@fruitcom.com> <050320102936.ZM9380@candle.brasslantern.com> <20050320190854.GC26316@fruitcom.com> <050320115822.ZM9627@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <050320115822.ZM9627@candle.brasslantern.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian os) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Thanks Bart. According to Bart Schaefer on Sun, Mar 20, 2005 at 11:58:22AM -0800: } On Mar 20, 8:08pm, Eric Smith - Fruitcom wrote: } > Subject: Re: defining real time variables for a shell } > Thanks Bart } } (Did you intentionally send this only to me, and not to the list? No big } deal, I just wondered.) Sorry, just carelessness. } > I would like to have the forex rates in vars in order to do } > my arithmatic on the command line. } } Ah, OK. In that case I think a sched command is indeed the way to go. } } > This rule in my prexec() make it easy for me to do math fast: } > elif [[ $cmd[1] == [\(\)0-9]* ]]; then } > application=calc } > ( I think you wrote that one for me :) ) Yeah, when I have a moment, I will write how I apply this command line "mailcap" to most things I do. For example entering a pdf file on one machine will launch a pdf viewer while doing the same thing on my remote server will submit that pdf to hylafax (which sends it to the fax numbers in the header section of the pdf). } Sort of; in fact, I just made reference to that thread in a zsh-workers } posting a few minutes ago. } } > so I might do something like: } > } > '(15/$GBP)+(3750/1900)' } > .... ooops - I see it is more complicated than i thought } > to have all your cake and eat it all :) } } Just get rid of the $ sign -- it's not necessary in math context unless } you're referring to something like the length of a string with $#scalar } or the number of arguments $# or a positional parameter like $3. } } '(15/GBP)+(3750/1900)' Huh? the GBP is a var, how can a bare string be interpolated. [eric@pepper ~] $ "(15/GBP)+(3750/1900)" "GBP" is undefined