Hi,
I am writing a script to run 'df -k' on remote machines and redirecting the output to a file.
This works fine but the problem I have it that as the tab length is 8 characters, anything larger than 8 chars is shifted right. Is there anything I can do to rectify this?
An extract/example from the scripts is as follows:
remsh $host df -lk | awk '{print $2 "\t\t" $3 "\t\t" $4 "\t\t" $5 "\t\t" $6}'> disk-usage-from-$host
I.E the columns displayed are:
kbytes used avail capacity Mounted
If the result outputs that the kbytes is greater that 8 chars the rest of the line shifts to the right and the columns do not appear in alignment with the smaller filesystems.
I have has a look at the tabs command etc
I am writing a script to run 'df -k' on remote machines and redirecting the output to a file.
This works fine but the problem I have it that as the tab length is 8 characters, anything larger than 8 chars is shifted right. Is there anything I can do to rectify this?
An extract/example from the scripts is as follows:
remsh $host df -lk | awk '{print $2 "\t\t" $3 "\t\t" $4 "\t\t" $5 "\t\t" $6}'> disk-usage-from-$host
I.E the columns displayed are:
kbytes used avail capacity Mounted
If the result outputs that the kbytes is greater that 8 chars the rest of the line shifts to the right and the columns do not appear in alignment with the smaller filesystems.
I have has a look at the tabs command etc