0
test `find /mnt/backups/mysql/information_schema-20120521-*.sql -type f -mmin -1500`

我正在尝试检查文件的年龄,但我收到“预期的一元运算符”和“意外的运算符”错误,具体取决于脚本中使用的 bash / sh。

我怎样才能避免它?

如果我不使用通配符“*”,那么一切正常,但必须使用它。

4

2 回答 2

1

我会尝试

find /mnt/backups/mysql/ -name "information_schema-20120521-*.sql" -type f -mmin -1500

如果您只想要 /mnt/backups/mysql/ 下的文件,也许添加 --maxdepth

于 2012-05-21T11:44:08.473 回答
0

尝试引用这个论点,因为通配符find似乎会导致 bash 出现问题:

test `find '/mnt/backups/mysql/information_schema-20120521-*.sql' -type f -mmin -1500`
于 2012-05-21T11:01:10.973 回答