如何在bash中读取字符串?

时间:2016-02-09 06:54:13

标签: bash shell command-line-arguments

我遇到了一个命令: -

/bin/bash -c LOCALHOST:/path/to/script --argument

它会出现/path/to/script之类的错误,但不存在/path/to/script

我想知道-c选项的工作原理。

1 个答案:

答案 0 :(得分:2)

你必须这样做

$ /bin/bash -c '/path/to/script --argument'

这些单引号内部基本上是您在按Enter键之前编写的行。