.bash_profile, "-bash: export: command not found"
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
0000000 ef bb bf 65 78 70 6f 72 74 20 47 54 4b 32 5f 52
357 273 277 e x p o r t G T K 2 _ R
0000020 43 5f 46 49 4c 45 53 3d 22 24 48 4f 4d 45 2f 2e
C _ F I L E S = " $ H O M E / .
0000040 67 74 6b 72 63 2d 32 2e 30 22 0a
g t k r c - 2 . 0 " \n
0000053
"less" prints this:
Code:
<U+FEFF>export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
So there's the UTF-8 notion? Is bash not UTF-8 compatible?
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.