View Single Post
Old 23rd September 2022
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,133
Default

These are documented in ksh(1):
Code:
The following forms of parameter substitution can also be used:

     [snip]

     ${name#pattern}
     ${name##pattern}
             If pattern matches the beginning of the value of parameter name,
             the matched text is deleted from the result of substitution.  A
             single `#' results in the shortest match, and two of them result
             in the longest match.

     ${name%pattern}
     ${name%%pattern}
             Like ${..#..} substitution, but it deletes from the end of the
             value.
From sh(1):
Code:
     ${parameter%[word]}
             Substitute parameter, deleting the smallest possible suffix
             matching word.

     ${parameter%%[word]}
             Substitute parameter, deleting the largest possible suffix
             matching word.

     ${parameter#[word]}
             Substitute parameter, deleting the smallest possible prefix
             matching word.

     ${parameter##[word]}
             Substitute parameter, deleting the largest possible prefix
             matching word.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote