Read the following link about string operators and pattern matching operator :
String Operators (Learning the Korn Shell, 2nd Edition)
Then understand and reproduce the given examples.
$ a=/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
$ echo $a
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
$ echo ${a#*/}
users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
$ echo ${a##*/}
1900_CDCRM_CBF71_13022010_13022010.txt
$ echo ${a%_*}
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010
$ echo ${a%%_*}
/users/home/ctsgnb/1900
$ echo ${a%.*}
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010
$ echo ${a#?}
users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
$ echo ${a##?}
users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
$ echo ${a%?}
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.tx
$ echo ${a%%?}
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.tx
---------- Post updated at 10:42 PM ---------- Previous update was at 10:23 PM ----------
You also have to understand meaning of meta character in regular expression see
Syntax of sed Commands (sed & awk, Second Edition)
---------- Post updated at 10:43 PM ---------- Previous update was at 10:42 PM ----------
some examples :
[ctsgnb@shell ~]$ echo $a
/users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/_/#/'
/users/home/ctsgnb/1900#CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/_/#/g'
/users/home/ctsgnb/1900#CDCRM#CBF71#13022010#13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/_/#/2'
/users/home/ctsgnb/1900_CDCRM#CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/_/#/3'
/users/home/ctsgnb/1900_CDCRM_CBF71#13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/ctsgnb/toto/'
/users/home/toto/1900_CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/.*/# &/'
# /users/home/ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/\(.*\)ctsgnb/ctsgnb\1/'
ctsgnb/users/home//1900_CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$ echo $a | sed 's/.*\(ctsgnb\)/\1/'
ctsgnb/1900_CDCRM_CBF71_13022010_13022010.txt
[ctsgnb@shell ~]$