5
如何检查Shell脚本中是否存在文件
我想编写一个Shell脚本来检查某个文件archived_sensor_data.json是否存在,如果存在,则将其删除。在http://www.cyberciti.biz/tips/find-out-if-file-exists-with-conditional-expressions.html之后,我尝试了以下操作: [-e archived_sensor_data.json] && rm archived_sensor_data.json 但是,这会引发错误 [-e: command not found 当我尝试test_controller使用./test_controller命令运行生成的脚本时。代码有什么问题?
175
shell