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

Using TAB "\t" makes line long, how to specify length of TAB? 1

Status
Not open for further replies.

hallux

Programmer
Feb 25, 2003
133
US
Hi,
I e-mail a file of system stats each day and want to straighten out the output for the "df" command. I put together an awk file, but the tabs are longer than necessary and exceed the 80-columns of output required.

I can straighten out the columns using awk as follows:
$ df | awk -f df.awk

$ cat df.awk
# df.awk -- precisely print df output
# input -- output from df (in AIX)
{ printf("%-20s\t%-14s\t%-14s\t%-12s\t%-10s\t%-15s\n", $1, $2, $3, $4, $5, $6)
}

Does anybody know how to make a shorter tab with awk?
-Brent
 

Use spaces, maybe?

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
CaKiwi,
Spaces don't straighten out the output, thanks for the suggestion.
I posted the question to the UNIX scripting forum as thread822-531443 and received some assistance in generating html output from df.
-Brent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top