SHARE
Facebook X Pinterest WhatsApp

IBM developerWorks: Awk by example, Part 3

Written By
thumbnail
Web Webster
Web Webster
Apr 7, 2001

[ Thanks to Kellie
for this link. ]

“In this conclusion to the awk series, Daniel introduces you to
awk’s important string functions, and then shows you how to write a
complete checkbook-balancing program from scratch. Along the way,
you’ll learn how to write your own functions and use awk’s
multidimensional arrays. By the end of this article, you’ll have
even more awk experience, allowing you to create more powerful
scripts.”

“While awk’s print statement does do the job most of the time,
sometimes more is needed. For those times, awk offers two good old
friends called printf() and sprintf(). Yes, these functions, like
so many other awk parts, are identical to their C counterparts.
printf() will print a formatted string to stdout, while sprintf()
returns a formatted string that can be assigned to a variable. If
you’re not familiar with printf() and sprintf(), an introductory C
text will quickly get you up to speed on these two essential
printing functions. You can view the printf() man page by typing
‘man 3 printf’ on your Linux system.”

Complete
Story

thumbnail
Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Recommended for you...

5 Best Free and Open Source Text Expander Tools
webmaster
Jun 13, 2025
Grafito: Systemd Journal Log Viewer with a Beautiful Web UI
Bobby Borisov
Jun 12, 2025
FreeBSD Wants to Know a Few Things
brideoflinux
May 11, 2025
NVK enabled for Maxwell, Pascal, and Volta GPUs
Kara Bembridge
May 1, 2025
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.