Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 140266 - bashrc independant of grep
Summary: bashrc independant of grep
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://roy.marples.name/node/267
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-13 11:50 UTC by michael@smith-li.com
Modified: 2006-07-19 23:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bashrc (bashrc,1.93 KB, text/plain)
2006-07-13 11:51 UTC, michael@smith-li.com
Details
bashrc (bashrc,1.70 KB, text/plain)
2006-07-15 09:36 UTC, michael@smith-li.com
Details
bashrc (bashrc,1.70 KB, text/plain)
2006-07-15 22:10 UTC, michael@smith-li.com
Details
bashrc (bashrc,1.70 KB, text/plain)
2006-07-18 09:51 UTC, michael@smith-li.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael@smith-li.com 2006-07-13 11:50:53 UTC
Per Roy's blog, I thought it would be more elegant if bashrc weren't dependant on grep. (The bash ebuild doesn't state any direct dependency on grep anyway, so it's a bit broken that bashrc uses it by default.)

To be attached shortly: a very slightly modified bashrc that doesn't use grep (but is only useful for >=app-shells/bash-3.0 )
Comment 1 michael@smith-li.com 2006-07-13 11:51:41 UTC
Created attachment 91654 [details]
bashrc

I think I said it all in comment #0
Comment 2 SpanKY gentoo-dev 2006-07-14 23:35:19 UTC
the unstated depend on grep is correct ... you cant even boot Gentoo without grep, so having a few errors in bashrc is the least of your problems

however, i still see `grep` in your proposed bashrc :P
Comment 3 michael@smith-li.com 2006-07-15 09:36:26 UTC
Created attachment 91792 [details]
bashrc

Oops! That's a redundant block of code that I forgot to delete. :-S

Yeah, I didn't really expect you to go "Wow, let's totally change the way we've been using UNIX-like systems for the last 30 years because bash got smarter."

This is more a proof-of-concept. But it does work, and as Roy demonstrated, it's a bit faster than grep. No harm there -- that's why I filed it as a feature enhancement. That's what it is :-)
Comment 4 SpanKY gentoo-dev 2006-07-15 21:10:48 UTC
actually, you dont even need to use =~ since it isnt a regular expression

[[ $'\n'$(</etc/DIR_COLORS)$'\n' == *$'\n'"TERM ${safe_term}"$'\n'* ]]
Comment 5 michael@smith-li.com 2006-07-15 22:10:56 UTC
Created attachment 91847 [details]
bashrc

(In reply to comment #4)
> actually, you dont even need to use =~ since it isnt a regular expression

Right you are, sir, and I think you just demonstrated a way this will work with bash versions earlier than 3.
Comment 6 SpanKY gentoo-dev 2006-07-16 00:24:42 UTC
why did you comment out the last line ?
Comment 7 michael@smith-li.com 2006-07-16 09:08:53 UTC
Oops again :-/

I set it that way for testing, and forgot to remove the '#'. I guess the EPA hates me.
Comment 8 Roy Marples (RETIRED) gentoo-dev 2006-07-18 09:44:08 UTC
Well, looks good to me - but uncomment the last line before it's comitted.
Comment 9 michael@smith-li.com 2006-07-18 09:51:35 UTC
Created attachment 92138 [details]
bashrc

I really hope I didn't screw this one up. According to diff the only difference between this and the previous one is the uncommented last line.
Comment 10 SpanKY gentoo-dev 2006-07-19 23:40:38 UTC
added to cvs, thanks