<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="ja"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="author" content="magicant"> <meta name="description" content="Yash の unset 組込みコマンドについて"> <title>Yash マニュアル: unset 組込みコマンド</title> <link rel="Contents" href="../index.html" title="目次"> <link rel="Prev" href="unalias.html" title="Unalias 組込みコマンド"> <link rel="Next" href="wait.html" title="Wait 組込みコマンド"> <link rel="Stylesheet" href="../style.css"> <div class="breadcrumb"><a href="../index.html">目次</a> > <a rel="Up" href="index.html">組込みコマンド一覧</a></div> <h1>Unset 組込みコマンド</h1> <p><dfn>Unset 組込みコマンド</dfn>は変数または関数を削除します。 <h2 id="syntax">構文</h2> <ul> <li><code>unset [-fv] [<var>名前</var>…]</code> </ul> <h2 id="description">説明</h2> <p>Unset コマンドはオペランドで指定した名前の<a href="../params.html#variables">変数</a>または<a href="../exec.html#function">関数</a>を削除します。 <p>元々存在しない変数・関数を削除しようとしても、何も起こりません (エラーにはなりません)。 <h2 id="options">オプション</h2> <dl> <dt><code>-f</code>, <code>--functions</code> <dd>関数を削除します。 <dt><code>-v</code>, <code>--variables</code> <dd>変数を削除します。 </dl> <p><code>-f</code> (<code>--functions</code>) オプションと <code>-v</code> (<code>--variables</code>) オプションの両方を指定した場合、後に指定したほうを優先します。どちらも指定していない場合は、<code>-v</code> を指定したものとみなします。 <h2 id="operands">オペランド</h2> <dl> <dt><var>名前</var> <dd>削除する変数または関数の名前です。 </dl> <h2 id="exitstatus">終了ステータス</h2> <p>エラーがない限り unset コマンドの終了ステータスは 0 です。 <h2 id="notes">補足</h2> <p>Unset コマンドは<a href="../builtin.html#types">特殊組込みコマンド</a>です。 <p>POSIX では、<code>-f</code> と <code>-v</code> のどちらのオプションも指定されていない場合、指定した名前の変数がない場合はかわりにその名前の関数を削除してよいと規定しています。