From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: defining real time variables for a shell
Date: Sun, 20 Mar 2005 22:04:55 +0000 [thread overview]
Message-ID: <1050320220456.ZM10820@candle.brasslantern.com> (raw)
In-Reply-To: <20050320200900.GD26316@fruitcom.com>
On Mar 20, 9:09pm, Eric Smith - Fruitcom wrote:
}
} } > 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.
I think you did already: zsh-users/6463 ?
} } > '(15/$GBP)+(3750/1900)'
} }
} } Just get rid of the $ sign -- it's not necessary in math context
} }
} } '(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
Um, what's the application "calc"?
When you said "my arithmatic on the command line" I assumed you were
using zsh's built-in arithmetic, in which bare strings are treated as
variable references.
E.g.,
schaefer[509] calc() { print $(( $* )) }
schaefer[510] GBP=1.44
schaefer[511] calc '(15/GBP)+(3750/1900)'
11.416666666666668
prev parent reply other threads:[~2005-03-20 22:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-20 17:05 Eric Smith
2005-03-20 18:29 ` Bart Schaefer
[not found] ` <20050320190854.GC26316@fruitcom.com>
[not found] ` <050320115822.ZM9627@candle.brasslantern.com>
2005-03-20 20:09 ` Eric Smith - Fruitcom
2005-03-20 22:04 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1050320220456.ZM10820@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).