-1

誰かがこのエラーの意味を知っていますか? Missing -.グーグルでは、これについて何も見つかりませんでした

4

1 に答える 1

2

tcsh がそのエラー メッセージを生成できる唯一のケースは、配列変数から単語の範囲を置き換えようとしていて、セレクターが構文的に正しくない場合です。

tcsh の man ページを引用します。

   $name[selector]
   ${name[selector]}
           Substitutes  only  the  selected  words from the value of name.
           The selector is subjected to `$' substitution and  may  consist
           of  a  single  number  or  two numbers separated by a `-'.  The
           first word of a variable's value is numbered `1'.  If the first
           number  of  a range is omitted it defaults to `1'.  If the last
           member of a range is omitted  it  defaults  to  `$#name'.   The
           selector `*' selects all words.  It is not an error for a range
           to be empty if the second argument is omitted or in range.

例えば:

$ echo $path[5-6]
/usr/sbin /usr/bin
$ echo $path[5_6]
Missing -.

おそらく、詳細情報 (失敗したスクリプトのコードなど) を求められたときにフォローアップしていれば、回答を得るのに 1 年もかからなかったでしょう。

于 2011-08-23T01:45:01.767 に答える