Should I use quotes in environment path names?

前端 未结 3 421
迷失自我
迷失自我 2021-01-30 16:53

I\'m in the process of cleaning up all my config files in an attempt to make them as readable as possible. I\'ve been looking for a style guide on the use of quotes while export

3条回答
  •  無奈伤痛
    2021-01-30 17:28

    test 123 is a valid path name on UNIX. Try

    PATH=test 123
    

    It will return:

    123: command not found
    

    Or even

    export PATH=test 123
    

    which will return

    bash export: `123': not a valid identifier
    

    Does it answer your question?

    Honestly I would not follow such fourth party style guides. Although I'm astonished that even Google advertises such wrong advices.

    I would follow:

    • http://www.tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginners-Guide.html
    • http://www.tldp.org/LDP/abs/html/
    • https://www.gnu.org/software/bash/manual/bash.html

    (to be carefully extended)

提交回复
热议问题