# Man pages in FreeBSD 9 are broken



## traustitj (Jan 21, 2012)

I just installed FreeBSD 9 on two machines, quite different hardware, one embedded AMD and one Quad Core Intel Core2Duo. Anyway, both machines do this on any man page:


```
# man vi
/usr/bin/man: eval: line 396: syntax error near unexpected token `|'
/usr/bin/man: eval: line 396: `/usr/bin/zcat /usr/share/man/man1/vi.1.gz |  |  -Tascii -P-c | more'
/usr/bin/man: line 396: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
```
Any help would be appreciated.


----------



## gordon@ (Jan 21, 2012)

Please post the output of `% man -d vi`


----------



## traustitj (Jan 22, 2012)

```
-- Using architecture: amd64:amd64
-- Using pager: more
-- Using manual sections: 1:1aout:8:2:3:n:4:5:6:7:9:l
-- Searching PATH for man directories
--   Adding /usr/share/man to manpath
--   Adding /usr/local/man to manpath
-- Adding default manpath entries
--   Adding /usr/share/openssl/man to manpath
-- Parsing config file: /usr/local/etc/man.d/perl5.12.4.conf
--   Adding /usr/local/lib/perl5/5.12.4/man to manpath
--   Adding /usr/local/lib/perl5/5.12.4/perl/man to manpath
-- Using manual path: /usr/share/man:/usr/local/man:/usr/share/openssl/man:/usr/local/lib/perl5/5.12.4/man:/usr/local/lib/perl5/5.12.4/perl/man
-- Using locale paths: .
-- Using standard page width
-- Searching for vi
--     Found manpage /usr/share/man/man1/vi.1.gz
--     Skipping catpage: not found or old
-- Command: /usr/bin/zcat /usr/share/man/man1/vi.1.gz |  |  -Tascii -P-c | more
```


----------



## wblock@ (Jan 22, 2012)

The last line is wrong, maybe others.  A 9.0-RC3 VM I had lying around shows this:

```
-- Command: /usr/bin/zcat /usr/share/man/man1/vi.1.gz | tbl | groff -S -P-h -Wall -mtty-char -man -Tascii -P-c | more
```

Have you changed settings in your shell startup file?


----------



## gordon@ (Jan 23, 2012)

Hmm, that is pretty odd. Please try once more but with more debugging:

`% man -ddd vi`


----------



## traustitj (Jan 23, 2012)

```
[tj@lianli ~]$ man -ddd vi
-- Using architecture: amd64:amd64
-- Using pager: more
-- Using manual sections: 1:1aout:8:2:3:n:4:5:6:7:9:l
-- Searching PATH for man directories
--   Adding /usr/share/man to manpath
--   Skipping duplicate manpath entry /usr/share/man
--   Adding /usr/local/man to manpath
-- Adding default manpath entries
--   Skipping duplicate manpath entry /usr/share/man
--   Adding /usr/share/openssl/man to manpath
--   Skipping duplicate manpath entry /usr/local/man
-- Parsing config file: /usr/local/etc/man.d/perl5.12.4.conf
--   MANPATH /usr/local/lib/perl5/5.12.4/man
--     MANPATH
--   Adding /usr/local/lib/perl5/5.12.4/man to manpath
--   MANPATH /usr/local/lib/perl5/5.12.4/perl/man
--     MANPATH
--   Adding /usr/local/lib/perl5/5.12.4/perl/man to manpath
-- Using manual path: /usr/share/man:/usr/local/man:/usr/share/openssl/man:/usr/local/lib/perl5/5.12.4/man:/usr/local/lib/perl5/5.12.4/perl/man
-- Using locale paths: .
-- Using standard page width
-- Searching for vi
-- Searching section 1
--   Searching directory /usr/share/man/man1
--     Found manpage /usr/share/man/man1/vi.1.gz
--     Skipping catpage: not found or old
-- Command: /usr/bin/zcat /usr/share/man/man1/vi.1.gz |  |  -Tascii -P-c | more
```


----------



## SirDice (Jan 23, 2012)

Did you set any locale(1) settings?


----------



## gordon@ (Jan 24, 2012)

Don't link /bin/sh to bash. It breaks things (like man(1)).


----------



## SirDice (Jan 24, 2012)

gordon@ said:
			
		

> Don't link /bin/sh to bash. It breaks things (like man(1)).



It's probably going to break a whole lot more too :OOO


----------



## gordon@ (Jan 24, 2012)

Here's a fun shell code to test in our shell vs bash:


```
FOO=bar

baz() {
  local FOO

  echo $FOO
}

baz
```


```
$ sh baz.sh
bar
$ bash baz.sh

$
```

Not sure exactly which one I would consider the bug. I think I like the FreeBSD version better. SUSv4 doesn't document the 'local' built-in at all.


----------



## traustitj (Jan 25, 2012)

Hi people,

Thanks so much. Unlinking /bin/sh to bash did the trick, things are working again,


----------



## fluca1978 (Jan 25, 2012)

If you really need to use /bin/bash you can change the shell using pw (not change csh  for the root user).


----------

