Skip to main content
1 of 2
rowboat
  • 3.1k
  • 7
  • 18

You can use paste -s to join lines:

shuf -i1-10 | paste -sd,

This uses -i option of shuf to specify a range of positive integers.

The output of seq can be piped to shuf:

seq 10 | shuf | paste -sd,

Or -e to shuffle arguments:

shuf -e {1..10} | paste -sd,
rowboat
  • 3.1k
  • 7
  • 18