0

I am trying to code a ~/.bashrc file for a raspberry pi, with raspberry pi os, and this is what I have (a modified version of the one that came by default in my own PC):

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

#export PATH=~/.local/bin:/snap/bin:/usr/sandbox/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/share/games:/usr/local/sbin:/usr/sbin:/sbin:$PATH

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

    

# some more ls aliases
alias ll='ls -lh'
alias la='ls -lha'
alias l='ls -CF'
alias em='emacs -nw'
alias dd='dd status=progress'
alias _='sudo'
alias _i='sudo -i'
alias please='sudo'
alias fucking='sudo'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

When this code is executed this error pops up:

-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: .bashrc: line 39: syntax error: unexpected end of file

For some reason, it always throws an Unexpected EOF error pointing at the very last line of the file, even if there isn't an EOF there. I have checked all quotes, both if statements, and all syntax myself and I can't figure out the syntax error of this file. Is there anything that I'm missing?

Ciro García
  • 601
  • 5
  • 22
  • Is there the file `~/.dircolors` and what does it contain if present? – Michael Jul 30 '21 at 15:02
  • @MichaelO. There isn't, but there isn't one in my PC either and it works. Could that be causing the problem on the raspberry pi? Edit: I have tried commenting out the `test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"` and it hasn't changed anything – Ciro García Jul 30 '21 at 15:10

0 Answers0