Skip to content

Instantly share code, notes, and snippets.

@Gottox
Created April 2, 2014 08:12
Show Gist options
  • Save Gottox/9929985 to your computer and use it in GitHub Desktop.
Save Gottox/9929985 to your computer and use it in GitHub Desktop.
/usr/lib shlib="libfoo.so"; pattern="^lib[[:alnum:]_-]+\.so(\.[0-9]+)*$"; [[ $shlib =~ $pattern ]] && echo yes
yes
/usr/lib shlib="libfoo.so.33"; pattern="^lib[[:alnum:]_-]+\.so(\.[0-9]+)*$"; [[ $shlib =~ $pattern ]] && echo yes
yes
/usr/lib shlib="libfoo.so.33.2"; pattern="^lib[[:alnum:]_-]+\.so(\.[0-9]+)*$"; [[ $shlib =~ $pattern ]] && echo yes
yes
/usr/lib shlib="libfoo.so.33.2."; pattern="^lib[[:alnum:]_-]+\.so(\.[0-9]+)*$"; [[ $shlib =~ $pattern ]] && echo yes
/usr/lib gist
(type a gist. <ctrl-c> to cancel, <ctrl-d> when done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment