a guest Mar 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- haystack=`mv random1231 random112211 2>&1`
- needle="No such file or "
- case $needle in
- # match start of string
- $haystack*) echo yep, it matches at the start ;;
- # match end of string
- *"$haystack") echo yep, it matches at the end ;;
- # searchString can be anywhere in thisString
- *"$haystack"*) echo yep, it matches in the middle somewhere ;;
- *) echo Not found ;;
RAW Paste Data