search

Home  >  Q&A  >  body text

php - shell script cannot find directory or file

Execute shell script on linux

But when executed, it displays

The directory does exist. what happened? ?

欧阳克欧阳克2743 days ago938

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-06-20 10:09:44

    When assigning values ​​to bash variables, there cannot be spaces on both sides of the equal sign. It should be written as:

    dir=/webserver/test/

    reply
    0
  • typecho

    typecho2017-06-20 10:09:44

    dir =/web...
    There can be no spaces on the left and right sides of the equal sign

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-20 10:09:44

    Don’t add a space after dir

    reply
    0
  • Cancelreply