test `find /mnt/backups/mysql/information_schema-20120521-*.sql -type f -mmin -1500`
我正在尝试检查文件的年龄,但我收到“预期的一元运算符”和“意外的运算符”错误,具体取决于脚本中使用的 bash / sh。
我怎样才能避免它?
如果我不使用通配符“*”,那么一切正常,但必须使用它。
test `find /mnt/backups/mysql/information_schema-20120521-*.sql -type f -mmin -1500`
我正在尝试检查文件的年龄,但我收到“预期的一元运算符”和“意外的运算符”错误,具体取决于脚本中使用的 bash / sh。
我怎样才能避免它?
如果我不使用通配符“*”,那么一切正常,但必须使用它。
我会尝试
find /mnt/backups/mysql/ -name "information_schema-20120521-*.sql" -type f -mmin -1500
如果您只想要 /mnt/backups/mysql/ 下的文件,也许添加 --maxdepth
尝试引用这个论点,因为通配符find
似乎会导致 bash 出现问题:
test `find '/mnt/backups/mysql/information_schema-20120521-*.sql' -type f -mmin -1500`