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!

How to append string to a variable

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi!
does anyone know how to append a string to a variable?
for example: $myfile='test'
where 'test' is something keyed in by the user so you dont actually know it's value....
how can I make the variable into $myfile=test1A ???
thanks!
-kitiara
 
myfile="test"
echo "enter stuff here: \c"
read newfile
myfile="$myfile$newfile"



crowe
 
It sounds like you are having trouble terminating your variable... Try using braces:

myfile=${myfile}1A
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top