The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-19-2005
nymus7 nymus7 is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 47
Question 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:

Code:
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

Code:
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