MANPATH: Undefined variable. % ?

  • Thread starter Thread starter Atr cheema
  • Start date Start date
  • Tags Tags
    Ubuntu Variable
Click For Summary
The issue arises when attempting to run a .csh file on Ubuntu 16.04, resulting in the error "MANPATH: undefined variable." This indicates that the MANPATH environment variable, which is crucial for the "man" command that displays application manuals, is not properly set in the shell running the script. Although "man" is installed, the variable's value is not being carried over from the login shell to the script's execution environment. To resolve this, users can check the current MANPATH by executing "echo $MANPATH" in the terminal. If it returns nothing, they should set the variable using "export MANPATH=$(manpath)" before running the .csh script. Additionally, reviewing the script for commands that set environment variables, such as "set" or "setenv," may provide further insights into the problem.
Atr cheema
Messages
67
Reaction score
0
I am installing an installing an open source software -on Ubuntu 16.04- by reading its 'http://ftp://ftp.chesapeakebay.net/../Modeling/Phase5/community/P53/README.txt' file. At certain point (point 3b in the link) the guideline requires me to run a .csh file located in a certain directory in order to generate executables. When I type csh on terminal in the required directory I am met with following line on terminal
Code:
MANPATH: undefined variable.
%

By pressing enter or Ctl+C nothing happens and I have to close the terminal. Can anyone guide me where is the error?
 
Computer science news on Phys.org
Atr cheema said:
I am installing an installing an open source software -on Ubuntu 16.04- by reading its 'http://ftp://ftp.chesapeakebay.net/../Modeling/Phase5/community/P53/README.txt' file. At certain point (point 3b in the link) the guideline requires me to run a .csh file located in a certain directory in order to generate executables. When I type csh on terminal in the required directory I am met with following line on terminal
Code:
MANPATH: undefined variable.
%

By pressing enter or Ctl+C nothing happens and I have to close the terminal. Can anyone guide me where is the error?
Is this step optional? I set up Ubuntu VMs all the time and there shouldn’t be any manual command line stuff unless you’re doing a very custom install or doing stuff after that’s company-specific.

MANPATH sounds like an environment variable and points to the command “man” which displays application manuals.

Not sure how it didn’t get installed but I’m assuming it can be fixed with
Sudo apt-get install man
Or
Sudo yum install manIf man already exists, you can simply set a perma-variable for it that points to the executable.
 
newjerseyrunner said:
Is this step optional? I set up Ubuntu VMs all the time and there shouldn’t be any manual command line stuff unless you’re doing a very custom install or doing stuff after that’s company-specific.

MANPATH sounds like an environment variable and points to the command “man” which displays application manuals.

Not sure how it didn’t get installed but I’m assuming it can be fixed with
Sudo apt-get install man
Or
Sudo yum install manIf man already exists, you can simply set a perma-variable for it that points to the executable.
If I execute the csh file from ubuntu terminal without going into interactive shell, the error persists. man is already installed and following is the output of manpath command when executed from terminal
Code:
/home/atrcheema/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man
 
newjerseyrunner said:
MANPATH sounds like an environment variable and points to the command “man” which displays application manuals.
No, MANPATH is supposed to point to the location of the "man pages" that the "man" command displays (e.g. "man ls").

Atr cheema said:
man is already installed and following is the output of manpath command when executed from terminal

Apparently the value of MANPATH isn't being carried over from your login shell to the shell that runs the script. Unfortunately, it's been a while since I've done this sort of thing, and I don't remember ever using a C shell script for this anyway, so my memory and knowledge are a bit fuzzy here. You might try looking at the script to see if there's a section that sets variables like this, using commands like "set" or "setenv". Or maybe you simply need to invoke the script in a different way that does carry over your environment variables such as MANPATH.
 
Atr cheema said:
If I execute the csh file from ubuntu terminal without going into interactive shell, the error persists. man is already installed and following is the output of manpath command when executed from terminal
Code:
/home/atrcheema/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man

Try running
Bash:
echo $MANPATH
(with MANPATH capitalised) in a terminal window. If this doesn't display anything then try doing
Bash:
export MANPATH=$(manpath)
before running your .csh script.
 
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

Replies
2
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 12 ·
Replies
12
Views
4K