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
  • 1
    On my phone so can't test, but would ${file#??????} be a posix sh compatible alternative? Commented Feb 25, 2020 at 12:00
  • @kojiro It is, tested on dash ash, ksh,zsh Commented Feb 25, 2020 at 12:12
  • mksh,pdksh. it does not work however on *csh shell variants and fish. The thing is the OP wants to retain the last 48 chars. Commented Feb 25, 2020 at 12:21