need help with printf command

Hi

How could I use the command printf to display a big file.
So ex. I've a script with some variables like:

V1=358504 V2=FD0147 V3=dev5 V4=94577 V5=0 V6=UNIX V7=Policy V8=server V9=04/15/05 V10=19:18:41 V11=2341321467

while read V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 
do
 printf "\n%s %s %s %s %s %s %s %s %s %s %s" $V1 $V2 $V3 $V4 $V5 $V6 $V7 $V8 $V9 $V10 $V11 >>/tmp/file.txt
done

then

cat /tmp/file.txt
358504 FD0147 dev5 94577 0 UNIX Policy
server 04/15/05 

First, it doesn't print on one line and second the variables V10 and V11 doesn't appears.
Have someones an idea to make the output on one line with all variables? perhaps an easier and better output.
Thx :slight_smile:

I ran your script .... it is expecting the input from stdin ...
and then going infinite loop.

I modified your script little bit ...
Just see "is this what you wanted ?"

But, still i''m not able to get what you are trying to do .


V1=358504 V2=FD0147 V3=dev5 V4=94577 V5=0 V6=UNIX V7=Policy V8=server V9=04/15/05 V10=19:18:41 V11=2341321467


for i in  $V1 $V2 $V3 $V4 $V5 $V6 $V7 $V8 $V9 $V10 $V11 
do
 printf "\n%s %s %s %s %s %s %s %s %s %s %s" $V1 $V2 $V3 $V4 $V5 $V6 $V7 $V8 $V9 $V10 $V11 
done