Last active
May 28, 2019 11:35
-
-
Save kallmanation/8f26464cadfa3eaeaf2c3c3b0f7e4918 to your computer and use it in GitHub Desktop.
Revisions
-
kallmanation revised this gist
May 28, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ catdeck() { if [[ "$#" -eq 0 ]]; then (>&2 echo "usage: $0 final_file_name.catdeck") exit 1 fi -
kallmanation revised this gist
May 24, 2019 . 1 changed file with 6 additions and 23 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,33 +2,16 @@ catdeck() { if [[ "$#" -eq 0 ]]; then (>&2 echo "usage: $0 final_file.name.catdeck") exit 1 fi OUTPUTFILE=$(echo "$1" | sed 's/\.catdeck//') echo -n "" > "$OUTPUTFILE" for FILE in `cat "$1"`; do 2>/dev/null cat "$FILE" >> "$OUTPUTFILE" || echo "$FILE" >> "$OUTPUTFILE" done } catdeck "$@" -
kallmanation created this gist
May 4, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/bin/bash catdeck() { if [[ "$#" -eq 0 ]]; then (>&2 echo "usage: $0 [-l seperator] filename.catdeck") exit 1 fi case "$1" in -l) OUTPUTFILE=$(echo "$3" | sed 's/\.catdeck//') echo -n "" > "$OUTPUTFILE" I=0 for FILE in `cat "$3"`; do if [ "$I" -eq 1 ]; then echo "$2" >> "$OUTPUTFILE" fi 2>/dev/null cat "$FILE" >> "$OUTPUTFILE" || echo "$FILE" >> "$OUTPUTFILE" I=1 done ;; *) OUTPUTFILE=$(echo "$1" | sed 's/\.catdeck//') echo -n "" > "$OUTPUTFILE" for FILE in `cat "$1"`; do 2>/dev/null cat "$FILE" >> "$OUTPUTFILE" || echo "$FILE" >> "$OUTPUTFILE" done ;; esac } catdeck "$@"