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.

2
  • Is there a solution to remove last extension but do nothing if no extension, on path like my.path/noext? It does happen on /etc/*.d/ for example
    – sayanel
    Commented Nov 13, 2023 at 10:01
  • 1
    Do you know what the extension would be? If e.g. it's .conf, you could do ${A%.conf}. That will leave the string intact if it doesn't end in .conf.
    – mwfearnley
    Commented Nov 13, 2023 at 10:32