Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
Created May 3, 2022 20:49
Show Gist options
  • Save 10maurycy10/e9554b08b515067524956570693c6d05 to your computer and use it in GitHub Desktop.
Save 10maurycy10/e9554b08b515067524956570693c6d05 to your computer and use it in GitHub Desktop.
A small script to select a entry from a file
#!/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