查找“;“缺少论点”;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中看到了此错误,但我没有用\代码>正确