You are not logged in.
Pages: 1
Hi all,
Getting this bash error every time I open a terminal. I've done a bit of reading on this error but I can't quite figure out how to fix it.
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Any suggestions?
Last edited by Gwynplaine (2014-11-13 15:03:37)
Offline
It's almost certainly something in your bashrc or bashprofile - post those files.
Off the top of my head, the only way to get that error is to have a quoted pound sign:
$ "#"
bash: #: command not found
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hi!
Could you check the contents of the following files in you home directory: .bashrc .bash_profile .profile or any other files that starts with "." (dot) ?
Offline
Contents of .bashrc:
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
export EDITOR="nano"
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
alsi
Contents of .bash_profile:
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
I don't have a .profile file.
Offline
Check the configs of alsi.
Offline
If you couldn't find anything you could check which are the files that the terminal is trying to open when it is starting with the following:
strace -o out.txt -vf -s 1024 -e open terminal
just change the name with the terminal which you are using...after that check the contents of the out.txt there must be some other files in which you have "#" sign.
Another thing that you can check before strace-ing you could try to comment tha last line of .bashrc --> alsi just to be sure if this is the problem or not.
Offline
It did actually start around the time I installed Alsi (sorry, I forgot to mention). I stopped using Archey because it started to display my ram as "-1623/2gb" or something along those lines.
I'm confused though because I actually removed alsi from .bashrc before posting and still had the same issue and same output from "echo $PATH".
I'm also not entirely sure what I should be looking for in the config files?
Last edited by Gwynplaine (2014-11-13 14:04:52)
Offline
Could you paste me the command which you type because i don't see .bashrc or any other files to be included?
Or just try to comment the line in .bashrc and check again
#alsi
Last edited by npetrov (2014-11-13 14:05:51)
Offline
I removed it from .bashrc and used "sudo pacman -Rns alsi" to remove it and the problem remains.
Also, the contents of out.txt:
1325 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libvte.so.9", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxfce4ui-1.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgtk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgdk-x11-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libatk-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgdk_pixbuf-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgio-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpango-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgobject-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxfce4util.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libglib-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpangocairo-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpangoft2-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libfontconfig.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libfreetype.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libcairo.so.2", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXext.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libncursesw.so.5", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libSM.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libICE.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libstartup-notification-1.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgmodule-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXfixes.so.3", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXrender.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXinerama.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXi.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXrandr.so.2", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXcursor.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXcomposite.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXdamage.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libffi.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgthread-2.0.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libharfbuzz.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libpixman-1.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libEGL.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-shm.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-render.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libGL.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXdmcp.so.6", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libuuid.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-util.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libX11-xcb.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgraphite2.so.3", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-dri2.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-xfixes.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-shape.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libgbm.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libwayland-client.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libwayland-server.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libglapi.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libdrm.so.2", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-glx.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-dri3.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-present.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-randr.so.0", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxcb-sync.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libxshmfence.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/libXxf86vm.so.1", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
1325 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/xfce4-terminal.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en_GB.utf8/LC_MESSAGES/xfce4-terminal.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en_GB/LC_MESSAGES/xfce4-terminal.mo", O_RDONLY) = 3
1325 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/lib/gconv/gconv-modules", O_RDONLY|O_CLOEXEC) = 3
1325 open("/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en_GB.utf8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en_GB/LC_MESSAGES/glib20.mo", O_RDONLY) = 3
1325 open("/usr/share/locale/en.UTF-8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en.utf8/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1325 open("/usr/share/locale/en/LC_MESSAGES/glib20.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
1326 +++ exited with 0 +++
1325 +++ exited with 0 +++
Offline
Ok, could you please delete out.txt and try again this :
strace -o out.txt -vf -s 8096 -e open gnome-terminal
...and paste the contents again?
EDIT:
Because the content of the file must be longer you could paste in into pastebin and give me a link to it
Last edited by npetrov (2014-11-13 14:15:17)
Offline
I've decided to use pastebin for the sake of formatting.
Here's the output of the new out.txt http://pastebin.com/6edzA1XG
Edit:
Looks like we had the same idea about pastebin.
Last edited by Gwynplaine (2014-11-13 14:24:54)
Offline
After removing the alsi line from .bashrc have you source the same file or just continued to use the same shell. The new configuration won't take effect until you source it (either by source .bashrc or by logging in again).
Offline
I entered "source .bashrc" into my terminal and received the error once again. I've also rebooted since then and there's no change.
Offline
One thing that can do this is a UTF BOM. (for example in your .bashrc)
It will look like this: (in your case # is the first line)
$ cat bad
#! /bin/bash
echo bad
$ bad
/home/main/bin/bad: line 1: #!: command not found
head -n 1 bad | hexdump -C
00000000 ef bb bf 23 21 20 2f 62 69 6e 2f 62 61 73 68 0a |...#! /bin/bash.|
In vim:
:set bomb
:set nobomb
Offline
Sorry, I'm pretty confused by those instructions and when I attempted to enter it into terminal:
$ cat bad
cat: bad: No such file or directory
Offline
I entered "source .bashrc" into my terminal and received the error once again. I've also rebooted since then and there's no change.
Well that's very useful for narrowing it down - it is definitely something in your bashrc then. Can you move/rename your bashrc and try starting a new terminal? If this avoids the problem, just delete that bashrc and start fresh - this would hardly be an inconvenience as there is nothing customized in your bashrc.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If you try to open a a new gnome terminal as root did you receive the same error?
There is a syntax error in one of the files which gnome-terminal is sourcing during startup, but we have to find which are these file to be able to find the error.
Procyon's assumption is a great one, but we need to know which are the files.
From the wiki https://wiki.archlinux.org/index.php/bash you could check which are the usual files ...
Last edited by npetrov (2014-11-13 14:52:10)
Offline
npetrov, sourcing his bashrc is sufficient to replicate the error message - so the problem must be in the bashrc file (or something invoked or included from it).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sure, sorry, i've missed that reply
Offline
Ok, problem is in .bashrc, but I do not see any syntax errors what-so-ever.
Offline
Thank you, everyone. I really appreciate all the help you've given me. I feel almost guilty for the amount of help I've received for such a simple thing.
I renamed .bashrc as Trilby suggested and the error had gone. So, I copied .bashrc back from /etc/skel/ to my home folder and again received no errors. Re-activated Alsi and everything worked fine.
Thanks again everyone.
Offline
I suspect (as Procyon's suggestions were also getting at) that you had somehow got some non-printable characters in there. I don't recall what it is exactly, but there are a few utf characters that are effectively invisible - not even showing up as space - if one of these was embedded before one of the # signs, it could have this result. These characters may have gotten into the file by copying and pasting a line from a website.
EDIT: one of those is utf character 2063 "invisible separator". You can see it's effects in the following two examples:
$ $(echo -e "\u2063#")
bash: #: command not found
$ echo -e "\u2063# some comment" > fakebashrc
$ cat fakebashrc
# some comment
$ source fakebashrc
bash: #: command not found
Last edited by Trilby (2014-11-13 15:13:34)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ahh, I see. Thank you for that information. I'll make a point of keeping an eye on that.
Edit:
Thank you for adding that example. That should be very helpful in case I run into something similar in the future.
Last edited by Gwynplaine (2014-11-13 15:16:28)
Offline
A hex editor/viewer (like xxd which comes with vim) is handy to check out suspicious files:
$ xxd fakebashrc
0000000: e281 a323 2073 6f6d 6520 636f 6d6d 656e ...# some commen
0000010: 740a t.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1