8
1
In the Ubuntu 18.04 LT .bashrc file there is the following:
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
Isn't xterm-color) an instance of unbalanced parentheses? And why does the line end with two semicolons?
To be clear, this is not something I wrote. It's in the virgin file, not edited by me.
If there are syntax errors, to whom should I report this?
11There's an easy way to check if this is a syntax error: just run it, and Bash will tell you whether it is a syntax error. In fact, this will be run every time you open a terminal, so you just have to look if there is a syntax error printed every time you open the terminal. – Jörg W Mittag – 2019-03-17T07:43:11.183
4if it's an error then you'll get a report every time you open a new terminal – phuclv – 2019-03-17T08:42:04.150
14Prior research might have included simply looking up the syntax for switch/case in Bash, through which you would have quickly discovered that this is entirely normal. – Lightness Races with Monica – 2019-03-17T16:37:32.550
6@JörgWMittag If you don't know what a script does, running it might be a not so clever idea. Checking it with
bash -n .bashrc
is probably better – ChatterOne – 2019-03-18T08:36:19.840@ChatterOne: It gets executed every single time you open a terminal; if there is something malicious about it, it will already have happened a long time ago. – Jörg W Mittag – 2019-03-20T18:22:37.743