I switched the shell on my main account to
zsh and when installing a script that logs history to a database, https://github.com/larkery/zsh-histdb, I saw that some
typeset commands in them didn't work, and after some searches I changed them to
declare and then they worked.
The files in question are https://github.com/larkery/zsh-histdb/blob/master/history-timer.zsh and https://github.com/larkery/zsh-histdb/blob/master/sqlite-history.zsh (at commit 0b89299, 2017-05-01) . The
typeset commands in the second one are at the beginning of the file.
What could be the difference between the author's set up and mine that would enable
typeset to work on theirs but not on mine?
My usual shell is
bash and changed only my regular logon account to
zsh and applied the
chsh -s $SHELL account to mine, but I don't know if it affects all the other accounts.
ls -l /bin/sh maps to
PS. As files like
.zshrc don't contain
#!/bin/sh what interpreter runs the commands in the when the user logons or some command requires a shell?
# contents of .zshrc export ZSH=/home/vfclists/.oh-my-zsh ZSH_THEME="agnoster" plugins=(git) source $ZSH/oh-my-zsh.sh if [ -f ~/.profile ]; then source ~/.profile fi # larkery historydb, https://github.com/larkery/zsh-histdb # paths must be configured by now if [ -f ~/bin/sqlite-history.zsh ]; then source ~/bin/sqlite-history.zsh fi source ~/bin/history-timer.zsh autoload -Uz add-zsh-hook add-zsh-hook preexec _start_timer add-zsh-hook precmd _stop_timer