Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
查找“;“缺少论点”;bash脚本中的错误_Bash_Shell_Unix - Fatal编程技术网

查找“;“缺少论点”;bash脚本中的错误

查找“;“缺少论点”;bash脚本中的错误,bash,shell,unix,Bash,Shell,Unix,我正在设置一个脚本,该脚本将svn将所有新的非subversion文件添加到subversion中,然后执行提交 #!/bin/bash find /path/to/uploads -type f -mmin -5 -not -iwholename '*.svn*'|xargs -r /usr/bin/svn add sleep 2 /usr/bin/svn commit /path/to/uploads -m auto_upload 从shell运行此命令时,我得到: find: missi

我正在设置一个脚本,该脚本将
svn将所有新的非subversion文件添加到subversion中,然后执行提交

#!/bin/bash
find /path/to/uploads -type f -mmin -5 -not -iwholename
'*.svn*'|xargs -r /usr/bin/svn add
sleep 2
/usr/bin/svn commit /path/to/uploads -m auto_upload
从shell运行此命令时,我得到:

find: missing argument to `-iwholename'
upload_images.sh: line 3: *.svn*: command not found

我需要避开星号吗?我很困惑。我在这里做了什么?

你在代码的中间有一个换行符>查找< /Cord>命令。这将导致
bash
将其解释为两个单独的命令。或者将其设为一行:

find /path/to/uploads -type f -mmin -5 -not -iwholename '*.svn*'|xargs -r /usr/bin/svn add
或者使用
\
继续:

find /path/to/uploads -type f -mmin -5 -not -iwholename \
'*.svn*'|xargs -r /usr/bin/svn add
听起来可能是复制+粘贴错误。

在-exec中看到了此错误,但我没有用
\正确