Can't find export command

Asked by Iain Houston

Sorry to be such a leech ... asking so many more questions than I can answer!

When I try to run 'export echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games or 'sudo export ...' I get 'sudo: export: command not found'
I try 'whereis export' and 'which export' but no sensible results
an echo $PATH produces
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
How can I fix this?

Many thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Iain Houston
Solved:
Last query:
Last reply:
Revision history for this message
Iain Houston (iainhouston) said :
#1

Sorryagain ... confused message!

Should say: When I try to run 'export' or 'sudo export ...' I get 'sudo: export: command not found'
I try 'whereis export' and 'which export' but no sensible results

echo $PATH gives:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#2

Thanks for your question.

export is not a program, it is a builtin command of the shell.

use the command "bash" to launch the bash shell first.

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#3

Another possibility is to use the corresponding command for the shell you are using.

If you are using csh, you should use "setenv var value" instead of "export VAR=value"

Revision history for this message
Iain Houston (iainhouston) said :
#4

Thanks Hanusz.
Still no joy, though:

iain@ubuntu:~$ bash
iain@ubuntu:~$ sudo export PANDO_HOME=/home/iain/pando/pandodl-18276
Password:
sudo: export: command not found

Revision history for this message
Iain Houston (iainhouston) said :
#5

Also:
~$ setenv var PANDO_HOME=/home/iain/pando/pandodl-18276
bash: setenv: command not found

Revision history for this message
Hanusz leszek (leszek-skynet) said :
#6

There is no need to use sudo, the command is:
export PANDO_HOME=/home/iain/pando/pandodl-18276

Revision history for this message
Best Iain Houston (iainhouston) said :
#7

Thanks. All working now.
Can't explain why. I restarted the Ubuntu system.
(Yes, I had tried with and without sudo)