Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

busybox sed captures space from expression with ^\s #66

Open
yogo1212 opened this issue Feb 16, 2023 · 0 comments
Open

busybox sed captures space from expression with ^\s #66

yogo1212 opened this issue Feb 16, 2023 · 0 comments

Comments

@yogo1212
Copy link

echo '8.8.8.8 via 192.168.0.1 dev br-n_1 src 192.168.0.37 uid 0  cache ' | sed -nE 's/^.*dev\s*([^\s]*).*$/\1/p' | hexdump -C
00000000  62 72 2d 6e 5f 31 20 0a                           |br-n_1 .|
00000008

Changing the capture to ([^ \s]*) removes the space from the output.

This is with Busybox 1.36.0 from Openwrt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant