Created
October 11, 2017 20:28
-
-
Save bgstack15/99a4bcf6618294986de33e94b4e65746 to your computer and use it in GitHub Desktop.
Convert input sets of numbers into numerical sequences
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
convert_to_seq() { | |
printf "${@}" | xargs -n1 -d',' | tr '-' ' ' | awk 'NF == 2 { system("/bin/seq "$1" "$2); } NF != 2 { print $1; }' | xargs | |
} | |
convert_to_seq "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment