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

Add a shuffle command #1503

Closed
joannavarrete opened this issue Jan 6, 2023 · 1 comment
Closed

Add a shuffle command #1503

joannavarrete opened this issue Jan 6, 2023 · 1 comment

Comments

@joannavarrete
Copy link

joannavarrete commented Jan 6, 2023

I whish I could use yq to shuffle the elements of an array.

I could be a command like reverse, for example:

yq 'sort_by(.a) | shuffle' sample.yml

Thanks

@mikefarah
Copy link
Owner

Fixed in v4.31.1, see https://mikefarah.gitbook.io/yq/operators/shuffle

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

No branches or pull requests

2 participants