LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-30-2004, 12:06 PM   #1
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Rep: Reputation: 31
Help! I think I broke the Less and Man commands...


Well I guess this is what I get when playing around as root on a console and not know what I am doing.

If I go to run the less command to look at a file (i.e. less profile) mandrake does not like it. It scrolls through every file in my /usr/bin directory extremely quickly. For example, here is what the sample output looks like even if I just type "less" in the console:

Quote:
/usr/bin/less: line 1583: yuvsplittoppm*: command not found
/usr/bin/less: line 1584: yuvtoppm*: command not found
/usr/bin/less: line 1585: zcmp*: command not found
/usr/bin/less: line 1586: zdiff*: command not found
/usr/bin/less: line 1587: zeisstopnm*: command not found
/usr/bin/less: line 1588: zforce*: command not found
/usr/bin/less: line 1589: zgrep*: command not found
/usr/bin/less: line 1590: zip*: command not found
/usr/bin/less: line 1591: zipcloak*: command not found
/usr/bin/less: line 1592: zipgrep*: command not found
/usr/bin/less: line 1593: zipinfo*: command not found
/usr/bin/less: line 1594: zipnote*: command not found
/usr/bin/less: line 1595: zipsplit*: command not found
/usr/bin/less: line 1596: zless*: command not found
/usr/bin/less: line 1597: zmore*: command not found
/usr/bin/less: line 1598: znew*: command not found
/usr/bin/less: line 1599: zonetab2pot.py*: command not found
Again this is just a sample of the output from the bottom. It scrolls through all 1599 files before it stops and dumps back to a prompt.

I have no idea how I broke this. I believe it was when I was wanting to run less on a file and have its output piped to grep so I could search for something. I believe the command I used was something like "less xyz | grep xyz". Is there a way I can look through the recent commands issued as root as see if I can see exactly what I typed in?

My other problem is that "man" seems to also be affected. If I do just "man" in the console, the system asks me what man page I want. Ok, that works. So then if I try "man less", or "man more", or "man anything", this is what I get:

Quote:
/usr/bin/less: line 1587: zeisstopnm*: command not found
/usr/bin/less: line 1588: zforce*: command not found
/usr/bin/less: line 1589: zgrep*: command not found
/usr/bin/less: line 1590: zip*: command not found
/usr/bin/less: line 1591: zipcloak*: command not found
/usr/bin/less: line 1592: zipgrep*: command not found
/usr/bin/less: line 1593: zipinfo*: command not found
/usr/bin/less: line 1594: zipnote*: command not found
/usr/bin/less: line 1595: zipsplit*: command not found
/usr/bin/less: line 1596: zless*: command not found
/usr/bin/less: line 1597: zmore*: command not found
/usr/bin/less: line 1598: znew*: command not found
/usr/bin/less: line 1599: zonetab2pot.py*: command not found
Error executing formatting or display command.
System command (cd /usr/share/man && (echo ".pl 1100i"; /usr/bin/bzip2 -c -d '/usr/share/man/man1/more.1.bz2'; echo ".\\\""; echo ".pl \n(nlu+10") | /usr/bin/gtbl | /usr/bin/nroff -Tlatin1 -mandoc -c | /usr/bin/less -isrR) exited with status 127.
This started happening when the "less" command broke.

Any idea on how to fix this??
 
Old 09-30-2004, 12:34 PM   #2
christhom
Member
 
Registered: Sep 2004
Distribution: Debian sarge/sid
Posts: 41

Rep: Reputation: 15
ok, in the future, you always want to do
<blah command> | grep foo | less
grep on the whole output, then page to see the results in a nice way.

Things you should look at. Firstly, clear all your LESS* environment variables. I assume you're using bash? type 'unalias -a'. See if that has any effect. If it works, something is either screwed with your LESS/LESSOPEN/LESSCLOSE/LESSKEY etc variables. Or the files they refer to.

Next look for suspicious things (like recently changes file times, about the time you were messing around) in /etc, looking for files /etc/less*.

Then, well, probably first, just test less itself, by using full path. /usr/bin/less foobar (where foobar is a file). any luck?

just some random things that I would do...

oh, btw - it's expected that man is broken, because man pipes things through $PAGER, which is usually less. you can work around by exporting PAGER=/bin/more. I assume your system has a *real* "more" command right?
 
Old 09-30-2004, 02:00 PM   #3
Biggen
Member
 
Registered: Sep 2004
Location: Panama City Beach FL
Distribution: Slackware 12.2
Posts: 199

Original Poster
Rep: Reputation: 31
Thanks for the help!

Unfortunately, "unalias -a" didn't seem to do anything. I can still do just a "less" in the shell and get all that output as well.

I also don't have any files that are less* in the /etc directory.

I also tried to use the full path "/usr/bin/less and I get the same thing...

I also tried typing in at the shell "PAGER=/bin/more" but man still seems broken. I am not sure what you mean by a *real more* command, but I do have more and it works. I have been using it as a substitute for less.

Grrr. This is frustrating... Is the "less" command just one file. In other words, can the file be replaced with a working "less" or does this have to be fixed or reformatted??
 
Old 09-30-2004, 03:34 PM   #4
christhom
Member
 
Registered: Sep 2004
Distribution: Debian sarge/sid
Posts: 41

Rep: Reputation: 15
1) by a *real* more - I mean is /bin/more a real binary, not just a symlink to less.
2) yes, at this stage, if /usr/bin/less gives you garbage, you can just replace it. it's part of the gnu less package, or you'll probably just be able to copy the file from a similar system (i.e one that is libc compatible), although it's usually best to replace the whole package, in case it's some weird config file you've barfed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apropos, man -k, man -f? krishvij Linux - Newbie 5 06-06-2005 01:42 PM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 08:52 AM
man "New Commands" Section Broken? tortle LQ Suggestions & Feedback 3 12-05-2004 11:59 AM
How to quit man (less) and keep man info on screen? peb Linux - Newbie 7 03-25-2004 10:02 PM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration