if echo "4567" | grep -q "^4"; then
echo "4567 is started with a 4."
elif echo "4567" | grep -q "^A"; then
echo "4567 is started with a A."
else
echo "4567 is NOT started with a 4 or A."
fi
Thursday, January 22, 2009
Regular Expression in if in bash script
Posted by techgeek168 at 8:41 AM
Labels: UnixBashVi
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment