How to test for if two files exist?

前端 未结 4 2040
耶瑟儿~
耶瑟儿~ 2021-02-02 07:11

I would like to check if both files exist, but I am getting

test.sh: line 3: [: missing `]\'

Can anyone see what\'s wrong?

#!/b         


        
4条回答
  •  你的背包
    2021-02-02 07:46

    Try adding an additional square bracket.

    if [[ -f .ssh/id_rsa && -f .ssh/id_rsa.pub ]]; then
    

提交回复
热议问题