i want to ask how can i read a variable?
like
for i in 1 2 3
do
cat file${1} | while read something
do
if [ ]
echo " file name: file${i}" >>temp
else
echo ", file${i}" >>temp
done
done
it is not working, can i do something like that?
actually i want the output below
file name: file1, file2, file3
can anyone please help me with the question?
Thank you
Please don't up bump up the posts - it's against the rules.
Not sure what you are looking for. try this
echo -n "filename: ";for i in 1 2 3;do echo -n "file${i} ";done
awk
5
On the cat command - you have ${1} instead of ${i} - that will not do what you seem to want.