.bash_profile, "-bash: export: command not found"
Hi there,
I was trying to get rid of qtconfig's error message "QGtkStyle was unable to detect the current GTK+ theme.". So I created the file ~/.gtkrc-2.0 with this content: Code:
gtk-theme-name="Xfce" Code:
export GTK2_RC_FILES="$HOME/.gtkrc-2.0" Code:
-bash: export: command not found I am running Slackware 13.1. |
export is a shell built-in command. It should be impossible to not find it. I'd be inclined to check your profile file for any non-printable/control-characters that may have crept in.
grep export < ~/.bash_profile | od -tx1c |
This file is UTF-8 encoded. Could this the problem?
Code:
christian@tux-netbook:~$ grep export < ~/.bash_profile | od -tx1c Code:
<U+FEFF>export GTK2_RC_FILES="$HOME/.gtkrc-2.0" |
I still don't know what caused this problems but I now added this line in my /etc/profile:
Code:
# GTK QT Support |
I know that this thread is a bit old, but I had the same problem running a script that I downloaded (check_snmp_printer from exchange.nagios.org) and ran on Ubuntu Server.
Somehow, the encoding at the start of the file was messed up. Though no extraneous characters appeared there in nano, the problem persisted after I had opened the file. I removed the first line, then replaced it by typing "#!/bin/bash" and inserting a line of space below it. After doing so, the script ran fine. Hope this helps others! :D |
Odds are that the file had Windows/DOS end-of-line characters. (That's CRLF or 0x0d 0x0A in hex). See "man fromdos" to see how to fix such a file.
|
No, it wasn't the line endings, it was a byte order mark. You can see it in the output in post #3. MS programs sometimes add them to text files.
http://en.wikipedia.org/wiki/Byte_order_mark |
Even Vim, under certain configurations, writes the BOM. To make sure it never does, put "set nobomb" in your .vimrc file.
|
The BOM shown above denotes UTF-16 encoding. You can easily convert to UTF-8 using iconv:
Code:
iconv -f UTF-16 -t UTF-8 file > newfile |
I'd say chances are they actually are UTF-8 files, just with BOMS inserted.
The Wikipedia entry says that while the BOM is not necessary for UTF-8, it's not actually invalid, and so some programs add them anyway. But most *nix applications choke on it in some way or another, so you really need to remove them when encountered. |
All times are GMT -5. The time now is 05:01 PM. |