You should use shuf
command =)
cat file1 file2 | shuf
Or with Perl :
cat file1 file2 | perl -MList::Util=shuffle -wne 'print shuffle <>;'
More Related Contents:
- What does set -e mean in a bash script?
- What does $@ mean in a shell script?
- Shell script: Run function from script over ssh
- Why does /bin/sh behave differently to /bin/bash even if one points to the other?
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- sh: 1: Syntax error: "(" unexpected error
- Iterate over a list of files with spaces
- ./configure : /bin/sh^M : bad interpreter [duplicate]
- How to declare 2D array in bash
- Defining a variable with or without export
- Better way to rename files based on multiple patterns
- Syntax error in shell script with process substitution
- Raise error in a Bash script
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to run a shell script on a Unix console or Mac terminal?
- How to preserve line breaks when storing command output to a variable?
- How to use sed to remove the last n lines of a file
- Use sudo without password INSIDE a script
- Should PATH contain directories or full paths to binaries?
- How do I run multiple background commands in bash in a single line?
- Round a divided number in Bash
- Recursively change file extensions in Bash
- Bash: wait with timeout
- Multithreading in Bash [duplicate]
- Running shell script in parallel
- Difference between shell and environment variables
- SUID not working with shell script
- How to convert hex to ASCII characters in the Linux shell?
- How to avoid race condition when using a lock-file to avoid two instances of a script running simultaneously?
- Need to remove the count from the output when using “uniq -c” command