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:
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:
Any idea on how to fix this?? |
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? |
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?? |
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. |
All times are GMT -5. The time now is 03:22 PM. |