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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create file names with the same prefix

Status
Not open for further replies.

jawon

Programmer
Feb 6, 2003
31
US
I have multiple files with the same "prefix". For instance...
"memlist"
"memweb"

How can I create variables containing these file names by having the prefix as another variable? For instance, something like...

for prefix in mem pvd
do
file1=$prefix.list
file2=$prefix.web
done

I know this is wrong because the result would have the period inserted. So maybe a better way to phrase the question is, how do I append the prefix to create another variable?
 
for prefix in mem pvd
do
file1=${prefix}list
file2=${prefix}web
done vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top