My scrapbook about anything which I learned or want to remember, Sometime about tech tips, thoughts and rambling. If you find anything useful don't forget to give thumbs-up :)

Breaking

Wednesday, September 23, 2015

Shell Script Scenario #6 - Shuffle the input



- Design a shell script which take some character or number or string as a input separated by space and generate a shuffled output from the input. The output should be random.


Input:
1 2 3 4 5 6 7

Output1: #when we run script 1st time (it can differ from your output)
7 1 4 2 3 6 5

Output2: #when we run script next time (it can differ from your output)
5 1 7 3 2 6 4


Or

Input:
a p s t u b

Output: #when we run script 1st time (it can differ from your output)
t b p s a u






Like the below page to get update  
https://www.facebook.com/datastage4you
https://twitter.com/datagenx
https://plus.google.com/+AtulSingh0/posts
https://groups.google.com/forum/#!forum/datagenx

No comments:

Post a Comment

Disclaimer

The postings on this site are my own and don't necessarily represent IBM's or other companies positions, strategies or opinions. All content provided on this blog is for informational purposes and knowledge sharing only.
The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of his information.