summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9341c14)
This function compares two strings (paths) and checks if the first
starts with the second (the first path lies within the second).
# Do the actual interpolation
echo $path | sed "$expr"
}
# Do the actual interpolation
echo $path | sed "$expr"
}
+
+# Does the $1 start with $2 ?
+function starts_with() {
+ # Get the head of $1 as long as $2
+ head=`echo $1 | head -c ${#2}`
+ # Is it equal to $2?
+ [ "$head" = "$2" ]
+}