Closed sumanthratna closed 4 years ago
When I open my terminal, I see:
precmd:1: bad math expression: operator expected at `N-15868274...'
In my .zshrc, I have:
.zshrc
export SILVER_SHELL="zsh" SILVER_START=$(date +%s%3N) unsetopt prompt_subst preexec() { SILVER_START=$(date +%s%3N) } precmd() { PROMPT="$(code=$? jobs=$(jobs | wc -l) cmdtime=$(($(date +%s%3N)-$SILVER_START)) silver print "${SILVER[@]}") " SILVER_START=$(date +%s%3N) }
If I change the date in cmdtime to gdate, I just get:
date
cmdtime
gdate
precmd:1: bad math expression: operator expected at `N'
zsh 5.7.1 (x86_64-apple-darwin19.0) on macOS 10.15.5 Beta
zsh 5.7.1 (x86_64-apple-darwin19.0)
You need to add an alias. alias date=gdate
alias date=gdate
Not sure how I missed that, I remember seeing it in the documentation. Thanks!
When I open my terminal, I see:
In my
.zshrc
, I have:If I change the
date
incmdtime
togdate
, I just get:zsh 5.7.1 (x86_64-apple-darwin19.0)
on macOS 10.15.5 Beta