Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
関数の最初の引数にアクセスするには、次を使用します
func() { echo $1; }
ashの関数の最後の引数に直接アクセスする方法は?
ループも関数も複雑なコマンドも使いたくない
使用できます$($#)。
$($#)
$#は引数の数 (最後の引数のインデックスに等しい) であり、$($#)最後の引数もそうです。
$#