Shell variable issue when trying to mkdir

前端 未结 3 1199
遇见更好的自我
遇见更好的自我 2021-01-02 00:32

Any ideas what is wrong with this code?

CLIENT_BUILD_DIR=\"~/Desktop/TempDir/\"

if [ ! -d $CLIENT_BUILD_DIR ]
then
   {
      mkdir $CLIENT_BUILD_DIR
   }
f         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 01:07

    The ~ character is not reinterpret when used in a variable.

    You can use CLIENT_BUILD_DIR="$HOME/Desktop/TempDir/" instead.

提交回复
热议问题