Linux.com

Author Message
Joined: Mar 24, 2008
Posts: 1
Other Topics
Posted Mar 24, 2008 at 5:31:59 PM
Subject: *RESOLVED* Yes, it's homework: problem awk string
I hope someone can help me with this. We're supposed to copy this script straight from the book. But when I do, I get an error. Here's the line that's giving me problems: [code=xml]awk -F: '{printf "%-12s %-12s %s\t%s %s %10.10s %\n", $2, $3, $4, $1, $5, $6, $7}' corp_phones[/code] The error I get is this: [code=xml]awk: (FILENAME=corp_phones FNR=1) fatal: not enough arguments to satisfy format string `%-12s %-12s %s %s %s %10.10s %s ' ^ ran out for this one[/code] The book tells me nothing about how to work around something like that. Can anyone help? Thanks. EDIT: I found a missing comma. Problem solved.
Back to top Profile Email Website
Shashank Sharma
Joined Jan 01, 1970
Posts: 1657
Location:New Delhi, India

Other Topics
Posted: Mar 29, 2008 6:06:20 PM
Subject: *RESOLVED* Yes, it's homework: problem awk string
Glad you found the solution yourself. Feels good, doesn't it :) Cheers!

Coauthor of Beginning Fedora: From Novice to Professional published by Apress.

Please follow the Forum Guidelines

Back to top Profile Email Website Yahoo!
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya