Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setopt command #29

Open
PeterKW opened this issue Nov 11, 2021 · 1 comment
Open

setopt command #29

PeterKW opened this issue Nov 11, 2021 · 1 comment

Comments

@PeterKW
Copy link

PeterKW commented Nov 11, 2021

If I run:

./.zshrc                                                                                                                                          ✔ 
/usr/share/zsh/manjaro-zsh-config: line 2: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 3: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 4: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 5: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 6: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 7: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 8: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 9: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 10: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 11: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 12: setopt: command not found
/usr/share/zsh/manjaro-zsh-config: line 14: zstyle: command not found
/usr/share/zsh/manjaro-zsh-config: line 15: ${(s.:.)LS_COLORS}: bad substitution

I get errors with setopt in the scripts, even when I write my own in .zshrc

Running something like the following in my terminal works with no errors.
setopt interactivecomments

Do I have something setup incorrectly?

I have been trying to have a way of passing in a variable command to run a long and a short version of commands in my zshrc aliases which works in bashrc but not in zshrc, so I was wondering if something to do with the setopt errors might be blocking it from running?

#~/.zshrc -l True
while getopts l: option
do
    case "${option}"
    in
        l) long=${OPTARG};; #Activate long edition true/false
    esac
done


if [[ -e ~/.zsh_aliases ]]; then
  source ~/.zsh_aliases -l $long
fi
@mozzieongit
Copy link
Contributor

That's probably because you're executing the file that should be sourced into your running shell. Also your .zshrc as well as /usr/share/zsh/manjaro-zsh-config don't have a shebang at the beginning, so that your zshrc is executed with sh instead of zsh.
To source your zshrc use source .zshrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants