Linux sucks

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
I got the feeling grep was buffering its output and I needed to get output as each individual line printed. Off to the man page...
cst@chi~% man grep
...
--line-buffering
Use line buffering, it can be a performance penality.
...
cst@chi~% cat /dev/urandom |grep --line-buffering
grep: unrecognized option `--line-buffering'
After some googling, I found out that it might be --line-buffered instead (you never know, with those amateurs who do OSS :|... might as well give it a shot)
cst@chi~% cat /dev/urandom | grep --line-buffered
grep: unrecognized option `--line-buffered'
</rant>
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I donno. What distro are you using?

Works for me in CentOS.

cat /dev/urandom | grep --line-buffered asdf

And the man page is accurate also on the actual grep command option.

grep --version
grep (GNU grep) 2.5.1

Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That was on CentOS 4.2

With Debian Stable it works... And the man page is accurate. The line-buffered version again. Same thing with Debian Unstable.

Looks like your distro's grep and it's man page is the part that sucks.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Looks like your distro's grep and it's man page is the part that sucks.
I know. But every distro sucks in one way or another. "Use another distro" is not a good solution to the unpleasant experience that is Linux, because at some point, no matter what the distro, you hit some problem whose solution is "use a different one".


Originally posted by: stash
I would second the man page suckage, especially if the following is verbatim from the page:

Use line buffering, it can be a performance penality.

It is. The messages when you quit SuSE Watcher and SuSE plugger are great too... "Do you want that SuSE Watcher show up next time you log in" (or something close to that). It really inspires confidence.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I'm just curious what distro your using and what version of grep they are.

It's GNU grep. GNU tools, GNU man pages, right? I don't see why it would be different unless your using a old distro or something. I figured that maybe you were ssh'd into FreeBSD or something and was mistaken.

Or maybe a grep from a different project? GNU's grep is definately not the only one out there and people may install a alternate one for one reason or another. (but GNU tools tend to be the best.. as opposed to something offered by Sun or whatnot)
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: drag
I'm just curious what distro your using and what version of grep they are.

It's GNU grep. GNU tools, GNU man pages, right? I don't see why it would be different unless your using a old distro or something. I figured that maybe you were ssh'd into FreeBSD or something and was mistaken.

Or maybe a grep from a different project? GNU's grep is definately not the only one out there and people may install a alternate one for one reason or another. (but GNU tools tend to be the best.. as opposed to something offered by Sun or whatnot)

cst@aphrodite~/725/final/South/starterFiles% grep --version
grep (GNU grep) 2.4.2

I can't find a version in the man page, but at the bottom it says:
GNU Project 2002/01/22 GREP(1)

cst@aphrodite~/725/final/South/starterFiles% cat /etc/issue.net
Welcome to SuSE Linux 9.3 (i586) - Kernel %r (%t).
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ah. Weird.

Looks like grep 2.4.2 is the older version from 2000. There was a couple releases since then and the latest is 2.5.1, which was released sometime in 2004.

From [L=here]http://www.gnu.org/software/grep/changes.html[/quote]
The new option --line-buffered fflush on everyline. There is a noticeable slow down when forcing line buffering.
2001-02-17 Alain Magloire

From Bernd Strieder :
# tail -f logfile | grep important | do_something_urgent
# tail -f logfile | grep important | do_something_taking_very_long
If grep does full buffering in these cases then the urgent operation
does not happen as it should in the first case, and in the second case
time is lost due to waiting for the buffer to be filled.
This is clearly spoken not grep's fault in the first place, but libc's.
There is a heuristic in libc that make a stream line-buffered only if a
terminal is on the other end. This doesn't take care of the cases where
this connection is somehow indirect.

Odd that Suse chooses to use a old grep. I wonder if they have a good reason.
*shrug*
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I would second the man page suckage, especially if the following is verbatim from the page:

I like most of them, they're meant to be a quick reference for usage and the majority fit that description just fine. Sadly the GNU people prefer info so the man pages for their tools are usually extremely brief and say "use info <command> to get the full manual". But generally even the worst man pages are better than the docs provided with Windows, half of the cli tools don't even print all or any of their cli arguments.
 

MadRat

Lifer
Oct 14, 1999
11,999
307
126
So grab the new grep in rpm form and install it. It can't be that difficult. :)
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
I've not found anything I can't do with Debian Stable, it all works fine. No "Get another distro" things here....
 

doornail

Senior member
Oct 10, 1999
333
0
0
Fedora Core 4:

$ grep --help | grep line-buff
--line-buffered flush output on every line

$ grep --version
grep (GNU grep) 2.5.1


Be happy. I hear that some OS's don't even come with Grep.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
XP comes with "find", which is remarkably similar to grep but with a more intuitive name .

I find the name completely unintuitive, I would expect a command called 'find' to find files, not strings. Not that grep is any better, but once you know it you're bound to remember it. =)
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: CTho9305
Be happy. I hear that some OS's don't even come with Grep.
XP comes with "find", which is remarkably similar to grep but with a more intuitive name ;).
What do you mean it's not intuitive?! Now why can't I grep my glasses...
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
Originally posted by: Brazen
Originally posted by: CTho9305
Be happy. I hear that some OS's don't even come with Grep.
XP comes with "find", which is remarkably similar to grep but with a more intuitive name ;).
What do you mean it's not intuitive?! Now why can't I grep my glasses...

:laugh:

ok, heres my chance to learn something new. Why did they call the function grep?
enquiring minds want to know.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Brazen
Originally posted by: CTho9305
Be happy. I hear that some OS's don't even come with Grep.
XP comes with "find", which is remarkably similar to grep but with a more intuitive name ;).
What do you mean it's not intuitive?! Now why can't I grep my glasses...

Exactly. Linux already has a find command.

It's used to help find files.

Do you find your glasses to look for a scratch on a lense? No, of course not. That doesn't make sense.

I use find to find files and then I use grep to look through the file for lines containing certain strings. And before you get all jumpy.. there is a look command also. It's used to look for lines that BEGIN with a certain string. Probably pre-dates grep.

In Windows you would use dir to find files then find to look through a file for lines with certain strings. :p
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
windows does have a grep tool in a res kit...I copied it to my windows tools folder and renamed it grep :))

now if only I could get it to accept switches correctly
 

MadRat

Lifer
Oct 14, 1999
11,999
307
126
Didn't systernals make a *nix-like version (common syntax) of grep for Windows?
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
Originally posted by: MadRat
Didn't systernals make a *nix-like version (common syntax) of grep for Windows?

while he was trying to grep his glasses , I was trying to grep how the command originated and found this windows grep utility for anyone interested.
http://www.wingrep.com/

edit:
Ok found my definition...
The name comes from a command in the Unix text editor ed that takes the form:

g/re/p

which means "search globally for lines matching the regular expression, and print them". There are various command line switches available when using grep that modify the default behaviour.
 

MadRat

Lifer
Oct 14, 1999
11,999
307
126
Originally posted by: Sunner
I'll definitely agree that SuSE Linux sucks.

An ELITE lifer should be able to be more specific than "SuSE Linux sucks". Please elaborate.
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
Originally posted by: MadRat
Originally posted by: Sunner
I'll definitely agree that SuSE Linux sucks.

An ELITE lifer should be able to be more specific than "SuSE Linux sucks". Please elaborate.

Well, the two main points would be:
YaST sucks ass, it's cluttered, unintuitive, and just all around useless.
SuSE Linux tries WAY too hard to be Windows, at least Redhat(which I'm not too fond of either) has somewhat sane config files in somewhat sane locations, trying to configure SuSE boxes without using the ass sucking YaST is a major PITA.

Well, that about covers it.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: MadRat
Originally posted by: Sunner
I'll definitely agree that SuSE Linux sucks.

An ELITE lifer should be able to be more specific than "SuSE Linux sucks". Please elaborate.

Why does Suse ship a old broken grep with 9.3 when everybody else and their mom has been using the latest version for something like 4 years now?

Suse does other bizzare stuff like that. Like shipping known broken QT libraries.. when they are the premier KDE distro?

Also they created Yast stuff when people needed it.. but kept it closed source until Novell themselves GPL'd it, unfortunately by that time it's pretty much to late as other distros have moved on.

Not getting down on Suse or anything.. Like was noted above each distro has their own brand of stupidity that users have to deal with, but stuff like that is probably what he was talking about.