| Summary: | grep -o doesn't give me the expected output | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | frater <fraterbugzilla> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | busybox-cvs, fraterbugzilla |
| Priority: | P5 | ||
| Version: | 1.13.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | 1.13.4 | ||
| Attachments: | Fix (against current git) | ||
Created attachment 509 [details]
Fix (against current git)
Please try this patch, or current git (where it is already applied)
|
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