Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • On which system have you your problem? $PATH is in upper case. Commented Apr 11, 2021 at 14:08
  • 1
    Brevity is acceptable, but fuller explanations are better. Commented Apr 11, 2021 at 15:21
  • This could be optimized into path=$(basename "$path") or path=${path##*/}. Note that the question asks about removing a component of the :-delimited list in $PATH. Your answer does not address this. Commented Apr 11, 2021 at 15:23