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

Re-implement rc_splitwords to accommodate arbitrarily many words #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spacefrogg
Copy link
Contributor

Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash.
Test patterns:

rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j

rc_splitwords $(seq 10000)
rc_splitwords "$(seq 10000)"

For the long sequence tests, performance was still a sub-second response with bash being considerably slower than the other shells.

As a side note: I object to the suppression of empty arguments, as these might be valid input, but kept it for compatibility.

Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash.
Test patterns:

rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j

rc_splitwords $(seq 10000)
rc_splitwords "$(seq 10000)"
@spacefrogg
Copy link
Contributor Author

Ping.

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