Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove a character from a variable 1

Status
Not open for further replies.

longhair

MIS
Feb 7, 2001
889
US
probably simple but it escapes me now.
hpux 11.
need to remove a character from a variable in a script, don't have access to sed or awk.
basically:
Code:
cat /files/dsdcwhd.txt | while read dcoff dctty dcmnth dcday dctime
do
finger -i |grep $dcoff >> /files/dsdcwhd1.txt
done
but i need to add dctty to the grep pattern with out the leading '*' that is in the variable.
any suggestions?
thanks in advance.
regards,
longhair
 
try this: ${dctty#\*}

not sure if it works, I just read on online man page, didn't test it.


HTH,

p5wizard
 
p5wizard,
thanks for the pointer.
dcttya=${tty#'*'}
does the trick
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top