diff --git a/compress b/compress new file mode 100755 index 0000000..3480b73 --- /dev/null +++ b/compress @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ -z "$1" ] || [ "$1" = '-h' ] || [ "$1" = '--help' ] || [ "$1" = 'help' ]; then + FILENAME=$(basename "$0") + printf "$FILENAME : tool to easily compress to tar.gz archives. +Created by Pierre Saunders @saundersp 2021\n\nUsage: +\t$FILENAME archive.tar.gz file1.txt file2.txt +\tCompress file1.txt and file2.txt content in the archive.tar.gz where the command is executed. +\n\t$FILENAME\n\t$FILENAME help\n\t$FILENAME --help\n\t$FILENAME -h\n\tDisplay this usage message.\n" +else + tar -czvf "$@" +fi diff --git a/convertUTF8 b/convertUTF8 new file mode 100755 index 0000000..5377a6e --- /dev/null +++ b/convertUTF8 @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ -z "$1" ] || [ "$1" = '-h' ] || [ "$1" = '--help' ] || [ "$1" = 'help' ]; then + FILENAME=$(basename "$0") + printf "$FILENAME : tool to easily convert file to UTF-8 encoding. +Created by Pierre Saunders @saundersp 2021\n\nUsage: +\t$FILENAME filename.txt\n\tConvert filename.txt to UTF-8 encoding. +\n\t$FILENAME\n\t$FILENAME help\n\t$FILENAME --help\n\t$FILENAME -h +\tDisplay this usage message.\n" +else + TMP_FILE=$(mktemp) + iconv -f "$(file -i "$1" | cut -d = -f 2)" -t "UTF-8" "$1" > "$TMP_FILE" && mv "$TMP_FILE" "$1" +fi diff --git a/extract b/extract new file mode 100755 index 0000000..8efd8bc --- /dev/null +++ b/extract @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ -z "$1" ] || [ "$1" = '-h' ] || [ "$1" = '--help' ] || [ "$1" = 'help' ]; then + FILENAME=$(basename "$0") + printf "$FILENAME : tool to easily extract tar.gz archives. +Created by Pierre Saunders @saundersp 2021\n\nUsage: +\t$FILENAME archive.tar.gz\n\tExtract content of archive where the command is executed. +\n\t$FILENAME\n\t$FILENAME help\n\t$FILENAME --help\n\t$FILENAME -h\n\tDisplay this usage message.\n" +else + tar -xzvf "$1" +fi