0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Bashテンプレート

Posted at

自分用に記載

#!/bin/bash
set -o errexit # set -e
set -o nounset # set -u
set -o pipefail

function usage() {
    cat 1>&2 <<COMMENT
__description__

Usage
-----

Parameters and Environment Variable
-----------------------------------

COMMENT
    exit 1
}

THIS_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly THIS_SCRIPT_DIR

# shellcheck source=/dev/null
source "$THIS_SCRIPT_DIR"/XXXX.sh

# __description__
# Globals:
#   None
# Arguments:
#   AAA
#   BBB
# Outputs:
#   ~/test.txt
function XXX() {
    local -r AAA=$1
    local -r BBB=$2
}

function main() {
    XXX "${AAA}" "${BBB}"
}

if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
    # 変数バリテーション and help
    if [[ "${1-}" == "-h" ]] || [[ -z "${1-}" ]]; then
        usage
    fi
    readonly AAA=$1
    readonly BBB=$2
    main
fi

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?