Trying to source ~/.bashrc to add an alias

Hi,
I’m using Kicksecure as my OS, not live.

I’m trying to add an alias, so when I modify the ~/.bashrc and then source it I get the following response :

/home/user/.bashrc:18: command not found: shopt
/home/user/.bashrc:26: command not found: shopt
/home/user/.bashrc:106: command not found: shopt
/usr/share/bash-completion/bash_completion:45: command not found: shopt
/usr/share/bash-completion/bash_completion:53: command not found: complete
/usr/share/bash-completion/bash_completion:56: command not found: complete
/usr/share/bash-completion/bash_completion:59: command not found: complete
/usr/share/bash-completion/bash_completion:62: command not found: complete
/usr/share/bash-completion/bash_completion:65: command not found: complete
/usr/share/bash-completion/bash_completion:68: command not found: complete
/usr/share/bash-completion/bash_completion:71: command not found: complete
/usr/share/bash-completion/bash_completion:74: command not found: complete
/usr/share/bash-completion/bash_completion:77: command not found: complete
/usr/share/bash-completion/bash_completion:80: command not found: complete
/usr/share/bash-completion/bash_completion:1596: parse error near `|'
/usr/libexec/helper-scripts/bashrc-terminal-emulator:18: command not found: shopt
[REDACTED FOR PRIVACY]
Welcome to Kicksecure (TM)!
https://www.kicksecure.com

Kicksecure Copyright (C) 2012 - 2023 ENCRYPTED SUPPORT LP
Kicksecure is Freedom Software, and you are welcome to redistribute it under
certain conditions; type "kicksecure-license" <enter> for details.
Kicksecure is a compilation of software packages, each under its own copyright and
license. The exact license terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Kicksecure GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law; for details type "kicksecure-disclaimer" <enter>.

Kicksecure is a derivative of Debian GNU/Linux.

Kicksecure is a research project.

default user account: user
default password: No password required. (Passwordless login.)

\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$

It then launches another shell with a weird prompt (last string at the end) where the alias does work, but when I quit and open another terminal the prompt is back to normal and the alias doesn’t work. When I check the .bashrc file the modification are still there.

Most likely there is something wrong with the alias.

These are bash scripting / programming issues. Not caused by Kicksecure. Therefore these should be resolved as per Self Support First Policy for Kicksecure.

My install is brand new, I haven’t modified anything other than decommenting the

alias la='ls -la'

line in the .bashrc file. I’ve even made yet another install to check if I accidently modified something and got the same result.

As far as I know, modifying the .bashrc file and then source it to add an alias permanently is the default way to do so but I may be wrong.
.

bash

append-once ~/.bashrc "alias la='ls -la'"

bash

la

Works for me.

I am very dumb, I changed the ~/.zshrc instead and it had the intended effect.
I was not clear that I wanted the default shell to have the alias, I just assumed it was bash by default.
I’m still confused about what happens when I source the ~/.bashrc tho

zsh and bash aren’t compatible for scripting.

See also: Shell, Default Interactive Shell, Hidden Text Attacks