tilde expansion in environment variable

后端 未结 2 1934
梦谈多话
梦谈多话 2020-12-07 02:31

In my .sh file, I have this, cp $file $SOME_PATH, while $SOME_PATH is exported as export SOME_PATH=\"~/path/to/path/\". But when I ran this .sh fil

相关标签:
2条回答
  • 2020-12-07 02:48

    Remove the quotation marks on your export:

    export SOME_PATH=~/path/to/path/
    
    0 讨论(0)
  • 2020-12-07 02:49

    use

    SOME_PATH=~/path/to/path/
    

    if you path have spaces, quote it

    SOME_PATH=~/"path with spaces"
    
    0 讨论(0)
提交回复
热议问题