[SOLVED] Randomize the comma separated string in shell
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
thank you for this solution
But i want like that each time when we run the script the order of words should be shuffled randomly.
one time we run the script the order will be ===> "test1,test3,test4"
another time when script will run again order should be changed like ==> "test3,test4,test1"
Thanks for your solution
but one problem is coming after running the script, it is appending comma in last word
how to remove this comma in last word and how to assign the output in some other variable like
this looks fine but it is not working in array it is giving the same order it is not showing the random order of array elements but is there any way to randomly shuffle the array elements directly without converting it as string