Monday, May 17, 2010

String matching for ascii characters only:
pattern="^([0-9|a-z|A-Z|-|_])+$"
----------------------------------------------------------------------------------------------

Bash Scripting:

#!/usr/bin/bash
#Replacing the string with some characters in bash

STR="shashikiran";

echo `expr match $STR '[a-z]*'`
echo ${STR//[a-z]/^}

will replace all the chars in the string with caret.