该标志不被识别(the flag ' ' is not recognized)

编程入门 行业动态 更新时间:2024-10-23 15:31:55
该标志不被识别(the flag ' ' is not recognized)

我需要编写一个bash脚本,第一个工作是从arcsight ESM导出包。 之后它需要将导出的档案移动到连接器服务器,但我还没有涉及到该部分。 我的问题是这样的:根据arcsight ESM手册,用于导出软件包的命令如下:

arcsight package –action export –package “/All Packages/Personal/Mypackage” –f packagebundle.arb –u username –p password –m managername

该命令只需要从ESM服务器上的arcsight主目录运行,否则bash不会将arcsight识别为命令。 我这样做,该命令似乎运行正常,因为它设法登录到ESM,返回说它正在导出包但后来我得到

国旗''不被识别

它停止了 它没有完成导出包,因为在运行命令后目标文件夹中没有“packagebundle.arb”文件。 所以我想问一下是否有人知道这个错误是什么以及如何解决它。 直到现在才发现它。 ArcSight版本为6.9,Linux版本为RHEL 5.5。

I need to write a bash script who's first job is to export a package from an arcsight ESM. afterwards it needs to move the exported archives to a connector server but i haven't gotten to that part yet. my issue is this: as per the arcsight ESM manual, the command for exporting the package is the following:

arcsight package –action export –package “/All Packages/Personal/Mypackage” –f packagebundle.arb –u username –p password –m managername

the command needs to be run from the arcsight home directory on the ESM server only, else bash doesn't recognize arcsight as a command. i did that, the command seems to run fine as it does manage to log in to ESM, return says it's exporting the package but then i get

The Flag '' is not recognized

and it stops. it doesn't finish exporting the package as there is no "packagebundle.arb" file in the destination folder after the running the command. so i'd like to ask if anyone has some idea about what this error is and how to fix it. couldn't find much about it until now. ArcSight version is 6.9 and linux version is RHEL 5.5.

最满意答案

我认为问题在于你引用一个卷曲的引用,如下所示:“,而不是直引用,如下:”。

一些文本编辑器将直引号更改为卷曲,因为它们看起来更好。 但是,这会破坏shell可执行文件,因为它不能识别引号。

这里是你的命令应该看起来像直引号arcsight package –action export –package "/All Packages/Personal/Mypackage" –f packagebundle.arb –u username –p password –m managername

示例:使用直引号和卷曲引号进行回显

直引号:

echo "test" > test

Qurly引用:

echo “test“ > “test“

正如你所看到的,bash没有将“解释为”。

I think the problem is that you are quoting with a curly quote, like this: “, instead of a straight quote, like this: ".

Some text editors change straight quotes to curly because they looks better. This does however break shell executables, because it does not recognize curly quotes.

Here is what your command should look like with straight quotes arcsight package –action export –package "/All Packages/Personal/Mypackage" –f packagebundle.arb –u username –p password –m managername

Example: echoing with straight vs curly quotes

Straight quotes:

echo "test" > test

Qurly quotes:

echo “test“ > “test“

As you can see bash does not interpret “ as a quote.

更多推荐

本文发布于:2023-08-01 04:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1353997.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不被   标志   recognized   flag

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!