Skip to main content
14 events
when toggle format what by license comment
Apr 25 at 17:59 history edited testing_22 CC BY-SA 4.0
Improved readability
Nov 8, 2022 at 21:49 comment added Oliver W. Another mnemonic, since your keyboard may be different (and some just "feel" the layout, rather than know it): the % symbol is typically encountered after a number, e.g. 90%, hence it is a suffix. The # symbol is typically leading comments or even just the first char in hashtags, so it's a common prefix. The purpose of both modifiers is to remove, one just removes a prefix (#), the other removes the suffix (%).
Jan 21, 2022 at 10:02 history edited luator CC BY-SA 4.0
Add link to documentation
Dec 20, 2021 at 5:24 comment added vampiire this didnt work for me in bash 5.0 or zsh 5.8
May 22, 2018 at 14:47 comment added CodingInCircles Simplest answer that worked with zero modifications. Thank you!
Jan 13, 2017 at 19:56 comment added DS. Mnemonic: "#" is to the left of "%" on a standard keyboard, so "#" removes a prefix (on the left), and "%" removes a suffix (on the right).
Aug 9, 2016 at 15:58 comment added Marek Podyma I've finally found documentation for it: Shell-Parameter-Expansion
Aug 9, 2016 at 15:51 comment added Marek Podyma Well explained. Thanks. What is official name of this functionality? Is there any documentation for it?
Mar 9, 2016 at 17:29 history edited Matt K CC BY-SA 3.0
add explanation as suggested
Mar 9, 2016 at 11:34 comment added K Erlandsson A description of how this actually works would be helpful
May 1, 2015 at 20:19 comment added Steven Lu Dunno about "absence of bashisms" considering that this is already moderately cryptic .... if your delimiter is a newline instead of a hyphen, then it becomes even more cryptic. On the other hand, it works with newlines, so there's that.
Jan 30, 2015 at 15:17 comment added Jens Plus 1 For knowing your POSIX shell features, avoiding expensive forks and pipes, and the absence of bashisms.
May 9, 2012 at 17:09 history edited Matt K CC BY-SA 3.0
edited body
May 9, 2012 at 17:02 history answered Matt K CC BY-SA 3.0