2009-08-28

Unix Bash: replace trailing / from string

a="dir/"

echo ${a%*/}

replace within string

a="awordb"

echo ${a//word/dog}

No comments: