如何检查是否存在远程文件?

使用 test 方法最适合使用 bash 条件语句进行文件检查

        if test("[ -f /tmp/foo ]")
            # do stuff
        end
Fork me on GitHub