MyTemplatePost


MyTemplateChapter.

#!/bin/bash
#
##  Modified: Today by E.L.F.
#
##  Licensed as:
##  http://www.opensource.org/licenses/mit-license.php
#
##  Script-name - MyTemplateScript
#
##  Mandatory 'root' check ; )
##  Yes, you may disable this check, but ... I put it in here, for good reason.
##  You are hereby warned. ; )
if
  [[ "$UID" = "0" ]]
then
  ##  \u21 prints out an EXCLAMATION mark. ; )
  printf '%b\n' "\tError: There is no need to run this script as: \u201c "${USER^}"\u21 \u201d"
  exit 1
else
  Usage()
  {
  ##  Use "${FUNCNAME[N]}", for function-names.
  ##  The "${0##*/}" construct is the same,
  ##  as its "$(basename "$0")" construct. ; )
  printf '%b\n' "\tUsage: "${0##*/}" yourfile.pdf"
  exit 1
  }
  clear
  if
    [ -z "$1" ]
  then
    Usage
##  Alternative code to run. For example, when user input is required/expected.
#  then
#    printf '%b' "\tEnter name for output file: "
#  read Arg
#    if
#      [[ -z "$Arg" ]]
#    then
#      Usage;exit 1
#    else
#      Out="$Arg"
#    fi
  else
    Arg="$1"
    filetype="$(file --mime-type -b "$1"|awk -F'/' '{print $2}')"
#    printf '%b\n' "Do something."
  fi
  ##  Clean up after yourself. ; )
  unset filetype Arg
fi
exit 0
Tiny Matroska pinguins

Tiny Matroska pinguins (Photo credit: Act, don’t think)


That’s all folks! 😆

Kindest regards,

Alex

ღ Ƹ̵̡ Ӝ̵̨̄ Ʒ ☆ ˜ ” * ° • . ¸ł¸ . • ° * ” ☆ ★ ☆ ę ˜

♫ d(。◕‿◕。)b ♪♪

Use the contact-form below, for feedback purposes.







Back to top.