diff options
author | B Stack <bgstack15@gmail.com> | 2018-06-05 21:54:43 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-06-05 21:57:10 -0400 |
commit | 9411d13c4940ccce70070327b1e40b690ed2813c (patch) | |
tree | 35960e6640da83b4e1f5984f97865bb89bda644a /convert_to_seq.sh | |
download | former-gists-9411d13c4940ccce70070327b1e40b690ed2813c.tar.gz former-gists-9411d13c4940ccce70070327b1e40b690ed2813c.tar.bz2 former-gists-9411d13c4940ccce70070327b1e40b690ed2813c.zip |
initial retrieval from github
Diffstat (limited to 'convert_to_seq.sh')
-rw-r--r-- | convert_to_seq.sh/convert_to_seq.sh | 5 | ||||
-rw-r--r-- | convert_to_seq.sh/description | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/convert_to_seq.sh/convert_to_seq.sh b/convert_to_seq.sh/convert_to_seq.sh new file mode 100644 index 0000000..5e92ff7 --- /dev/null +++ b/convert_to_seq.sh/convert_to_seq.sh @@ -0,0 +1,5 @@ +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"
\ No newline at end of file diff --git a/convert_to_seq.sh/description b/convert_to_seq.sh/description new file mode 100644 index 0000000..10e1ab8 --- /dev/null +++ b/convert_to_seq.sh/description @@ -0,0 +1 @@ +Convert input sets of numbers into numerical sequences
\ No newline at end of file |