Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: defining real time variables for a shell
- X-seq: zsh-users 8615
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: defining real time variables for a shell
- Date: Sun, 20 Mar 2005 22:04:55 +0000
- In-reply-to: <20050320200900.GD26316@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050320170559.GA30366@xxxxxxxxxxxx> <050320102936.ZM9380@xxxxxxxxxxxxxxxxxxxxxxx> <20050320190854.GC26316@xxxxxxxxxxxx> <050320115822.ZM9627@xxxxxxxxxxxxxxxxxxxxxxx> <20050320200900.GD26316@xxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author