Created
May 3, 2022 20:49
-
-
Save 10maurycy10/e9554b08b515067524956570693c6d05 to your computer and use it in GitHub Desktop.
A small script to select a entry from a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[[ -z $1 ]] && echo "You must specify a file" | |
[[ -z $1 ]] && exit 1 | |
[[ -z $2 ]] && count=1 | |
[[ -z $2 ]] || count="$2" | |
shuf -n "$count" -- $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment