diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-18 19:46:44 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-18 19:46:44 +0200 |
| commit | 6d3940a381a91f61c87ecb9f01f99c897b1aaf00 (patch) | |
| tree | a28377c779b7968748c996709a42bace1bde899c /content/en | |
| parent | 5a54cb9434af78893d8571ecafff5309d4968554 (diff) | |
| download | danixxyz-6d3940a381a91f61c87ecb9f01f99c897b1aaf00.tar.gz danixxyz-6d3940a381a91f61c87ecb9f01f99c897b1aaf00.zip | |
removed all occurrencies of the highlight shortcode. File removed.
Diffstat (limited to 'content/en')
| -rw-r--r-- | content/en/articles/gify-back-to-bash-scripting/index.md | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/content/en/articles/gify-back-to-bash-scripting/index.md b/content/en/articles/gify-back-to-bash-scripting/index.md index 7841895..647c8ea 100644 --- a/content/en/articles/gify-back-to-bash-scripting/index.md +++ b/content/en/articles/gify-back-to-bash-scripting/index.md @@ -41,7 +41,8 @@ I made this script mostly for fun and personal use, so it's absolutely not idiot I'll leave you with a copy of the script here in case you want to have a look at it before downloading. Enjoy! -{{< highlight bash "linenos=true" >}}#! /bin/bash +```bash +#! /bin/bash # Author: Danilo 'danix' Macri # Author URI: https://danix.xyz @@ -80,7 +81,7 @@ MOGRIFY=$(which mogrify) CONVERT=$(which convert) # we need mogrify and convert from the imagemagik toolset for this script to work # -if [[ ! -x $MOGRIFY || ! -x $CONVERT ]]; then +if [[ ! -x $MOGRIFY || ! -x $CONVERT ]]; then showerror missingdeps exit $E_MISSINGDEPS fi @@ -91,20 +92,20 @@ showhelp () { case $1 in resize ) - echo "USAGE: $(basename $0) -r | --resize [width] [extension]" + echo "USAGE: $(basename $0) -r | --resize [width] [extension]" ;; gif ) - echo "USAGE: $(basename $0) -g | --gif [delay] [extension] [output file name]" + echo "USAGE: $(basename $0) -g | --gif [delay] [extension] [output file name]" ;; * ) #|----------------------- TEXT MAX WIDTH - 80 CHARS ----------------------------| echo -e "$(basename $0) - create animated gifs from images inside current directory" - echo -e "USAGE: $(basename $0) <option> [arguments]" - echo -e "\twhere <option> is one between:";echo - echo -e "\t-r | --resize [width] [extension]" + echo -e "USAGE: $(basename $0) <option> [arguments]" + echo -e "\twhere <option> is one between:";echo + echo -e "\t-r | --resize [width] [extension]" echo -e "\t\tresizes all the images matching the extension in the current folder to" echo -e "\t\tthe width specified as argument.";echo - echo -e "\tg | --gif [delay] [extension] [output file name]" + echo -e "\tg | --gif [delay] [extension] [output file name]" echo -e "\t\tcreates the gif file using all the images in the current folder." echo echo -e "EXAMPLES:" @@ -123,7 +124,7 @@ esac # showerror # showerror () { - if [ -z $1 ];then + if [ -z $1 ];then echo "INTERNAL ERROR - ABORTING"; echo exit $E_INTERROR fi @@ -152,13 +153,13 @@ showerror () } ##### MAIN ##### -if [ $# -eq 0 ];then +if [ $# -eq 0 ];then showerror noopts showhelp exit $E_NOOPTS else - while [ $# -gt 0 ];do + while [ $# -gt 0 ];do case $1 in -h|--help) showhelp @@ -168,21 +169,21 @@ else WIDTH=$2 EXT=$3 shift - if [[ -z $WIDTH || -z $EXT ]];then + if [[ -z $WIDTH || -z $EXT ]];then showhelp resize showerror noargs exit $E_NOARGS fi IMAGES="$(ls -1 *.$EXT 2>/dev/null | wc -l)" - if [[ $IMAGES == 0 ]]; then + if [[ $IMAGES == 0 ]]; then showerror noimages exit $E_NOIMAGES fi clear COUNT="$(ls -1 *.$EXT 2>/dev/null | wc -l)" echo "you're going to resize all $COUNT .$EXT images inside $PWD at a fixed width of ${WIDTH}px" - read -p "do you wish to continue? [y/n] " -n 1 -r; echo - if [[ ! $REPLY =~ ^[Yy]$ ]] + read -p "do you wish to continue? [y/n] " -n 1 -r; echo + if [[ ! $REPLY =~ ^[Yy]$ ]] then exit $USERABORTED else @@ -195,16 +196,16 @@ else EXT=$3 OUTPUT=$4 shift - if [[ -z $DELAY || -z $EXT || -z $OUTPUT ]];then + if [[ -z $DELAY || -z $EXT || -z $OUTPUT ]];then showhelp gif showerror noargs exit $E_NOARGS - elif [[ -f ${OUTPUT}.gif ]]; then + elif [[ -f ${OUTPUT}.gif ]]; then showerror filexists exit $E_FILEXISTS fi IMAGES="$(ls -1 *.$EXT 2>/dev/null | wc -l)" - if [[ $IMAGES == 0 ]]; then + if [[ $IMAGES == 0 ]]; then showerror noimages exit $E_NOIMAGES fi @@ -213,8 +214,8 @@ else echo "you're going to create a looping gif named ${OUTPUT}.gif" echo "out of all the $COUNT $EXT files inside $PWD with a tick" echo "delay of $DELAY/100 of a second"; echo - read -p "do you wish to continue? [y/n] " -n 1 -r; echo - if [[ ! $REPLY =~ ^[Yy]$ ]] + read -p "do you wish to continue? [y/n] " -n 1 -r; echo + if [[ ! $REPLY =~ ^[Yy]$ ]] then exit $USERABORTED else @@ -230,5 +231,4 @@ else shift done fi - -{{< /highlight >}}
\ No newline at end of file +```
\ No newline at end of file |
