egrep ignores begin of line on Mac OS XDarwin UNIX commands doesn't always seem to follow standard rules, such as the "sed won't produce new line on Mac OS X " issue. I just found another exception: $ echo "Contagion" | egrep -o '^.' It's not suppose to do that. It completely ignored the beginning line character in the regular expression. The same example produced the correct result on Ubuntu Linux: $ echo "Contagion" | egrep -o '^.' Luckily, there is an easy work around that will work on both systems: $ echo "Contagion" | egrep -o '^.' | head -1 Just wished I didn't have to resort to thtat. Chieh Cheng
Did your message disappear? Read the Forums FAQ. Add Comment
TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here. Messages, files, and images copyright by respective owners. |
Articles
|
Wiki
233 Users Online
![]() |
Copyright © 2004 - 2025. All Rights Reserved. |