On Thursday, 2009-12-10, Duncan wrote: > # Get my path, assuming / as the directory separator. > # These operators can be used in ${var-op-pat} constructs to > # return the string with the matching pattern removed: > # # is shortest match pattern at the left of string > # % is shortest match pattern at the right of string > # ## is longest match pattern at the left of string > # %% is longest match pattern at the right of string > # On the US keyboard layout at least, # and % are just > # left and right of the $ var indicator, making them > # easy to remember. Similarly, the doubled form is > # longer than the single, for longer matches. > # Do remember it's the match that's /removed/. > # When I first started, that seemed like negative > # logic to me as I wanted the match /saved/, but that's > # usually possible going from the other end. Or use > # sed/grep/cut or the like for more complicated stuff. > mypath=${me%/*} man 1 dirname :) Cheers, Kevin -- Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring
Attachment:
signature.asc
Description: This is a digitally signed message part.
___________________________________________________ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.