Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

bash | パラメータの取得

概要

パラメータの取得

詳細

パラメータ 内容
@n nは数値。入力引数をインデックス指定で取得
$@ 全ての引数を取得
$# 引数の数を取得

サンプル

コード
#!/bin/bash
echo $0 $1 $2
echo $@
echo $#
出力
$ ./hige.bash one two three
./hige.bash one two
one two three
3