Unix 中的错误(脚本)

发布于 2024-09-03 20:44:32 字数 64 浏览 7 评论 0原文

有人知道这个错误是什么意思? Missing -. 在谷歌中我没有找到任何关于这个的信息

somebody knows what does this error mean?
Missing -. in google I found nothing about this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿嘿嘿 2024-09-10 20:44:32

tcsh 可能产生该错误消息的唯一情况是当您尝试替换数组变量中的一系列单词时,并且选择器在语法上不正确。

引用 tcsh 手册页:

   $name[selector]
   ${name[selector]}
           Substitutes  only  the  selected  words from the value of name.
           The selector is subjected to `

例如:

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

也许如果您在被要求提供更多信息(例如,失败脚本中的一些代码)时进行了跟进,那么可能不需要一年多的时间才能得到答案。

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.

例如:

也许如果您在被要求提供更多信息(例如,失败脚本中的一些代码)时进行了跟进,那么可能不需要一年多的时间才能得到答案。

The only case where tcsh can produce that error message is when you're trying to substitute a range of words from an array variable, and the selector is syntactically incorrect.

Quoting the tcsh man page:

   $name[selector]
   ${name[selector]}
           Substitutes  only  the  selected  words from the value of name.
           The selector is subjected to `

For example:

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

Perhaps if you had followed up when you were asked for more information (like, say, some code from the failing script), it wouldn't have taken over a year to get an answer.

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.

For example:

Perhaps if you had followed up when you were asked for more information (like, say, some code from the failing script), it wouldn't have taken over a year to get an answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文