$PWD vs. pwd regarding portability

前端 未结 5 1217
孤独总比滥情好
孤独总比滥情好 2021-02-07 06:00

I\'m writing a shell script which parses the path of the current working directory (printing a like of all basenames above the current directory).

So far, I\'ve been usi

5条回答
  •  借酒劲吻你
    2021-02-07 06:55

    If it were me, I'd use pwd since it is a built-in both for bash and sh. That does not mean they work identically in all respects, but if you are invoking it without options, that shouldn't matter.

提交回复
热议问题