Bug 489 - grep -o doesn't give me the expected output
Summary: grep -o doesn't give me the expected output
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.13.x
Hardware: Other Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-28 08:29 UTC by frater
Modified: 2009-08-09 21:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build: 1.13.4


Attachments
Fix (against current git) (2.97 KB, patch)
2009-07-28 23:21 UTC, Denys Vlasenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description frater 2009-07-28 08:29:03 UTC
I like to use "egrep -o" in scripts where I want to parse a certain expression...

I have a DD-WRT router and also have optware installed so I can do a direct comparison.

root@WAN:~# nvram get wl0_maclist 2>/dev/null
00:19:3E:00:AA:5E 00:1D:60:3D:3A:FB 00:22:43:49:FB:AA
root@WAN:~# nvram get wl0_maclist 2>/dev/null | egrep -o '([[:xdigit:]]{2}[:-]){5}[[:xdigit:]]{2}'
00:19:3E:00:AA:5E
root@WAN:~# nvram get wl0_maclist 2>/dev/null | /opt/bin/egrep -o '([[:xdigit:]]{2}[:-]){5}[[:xdigit:]]{2}'
00:19:3E:00:AA:5E
00:1D:60:3D:3A:FB
00:22:43:49:FB:AA
Comment 1 Denys Vlasenko 2009-07-28 23:21:20 UTC
Created attachment 509 [details]
Fix (against current git)

Please try this patch, or current git (where it is already applied)