how to read a file to an echo statement

I was searching for an option where i can echo some strings together with the contents of a file.

Eg. I was to echo the below string to a file
"alter application PMS_ add variable CurrYear Y2009;" >> ${ESS_MAXL_DIR}/PMS_SUB.txt

The value 2009 is coming from a file called date.txt without the Y, so i'm looking for an option to get Y2009 to my echo statement.

Can somebody please help me with this?

Regards

CK

you mean like this???

fnsonlu1-/home/fnsonlu1> cat vv
2009
fnsonlu1-/home/fnsonlu1> echo "Y"`cat vv`
Y2009

Thanks a lot Vidya this is the one!!!!!!:):slight_smile:

few more ways!!!

fnsonlu1-/home/fnsonlu1> printf "Y"`cat vv`"\n"
Y2009
fnsonlu1-/home/fnsonlu1> sed 's/\(.*\)/Y\1/g' vv
Y2009
fnsonlu1-/home/fnsonlu1> awk '{print "Y"$0}' vv
Y2009
1 Like