bash trick: build-in method
A="abcd0123456789"
if [ "${A/1234/}" != "$A" ] ; then
echo yes
fi
grep method
A="abcd0123456789"
if echo $A | grep -q 1234 ; then
echo yes
fi
After I test, 1st method is 40 times faster then grep method
bash trick: build-in method
A="abcd0123456789"
if [ "${A/1234/}" != "$A" ] ; then
echo yes
fi
grep method
A="abcd0123456789"
if echo $A | grep -q 1234 ; then
echo yes
fi
After I test, 1st method is 40 times faster then grep method
This page contains a single entry by Pank published on January 7, 2005 7:05 PM.
Useful Firefox Trick was the previous entry in this blog.
Genuine Microsoft Software is the next entry in this blog.
Find recent content on the main index or look in the archives to find all content.
Leave a comment