Skip to main content

Free-Format Output Using cat

  • Chapter
  • 1354 Accesses

Abstract

There are many ways to send script output to the screen or to a file. The technique demonstrated in this chapter for creating preformatted output is simple to code. Many times I have coded scripts that write entries to a log, create a configuration file, or generate formatted usage output one line at a time by redirecting the output of echo statements. This works perfectly well, but the code looks a bit ugly and becomes tedious; it is also laborious to make changes because each echo statement has to be formatted individually.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Ron Peters

About this chapter

Cite this chapter

(2009). Free-Format Output Using cat. In: Expert Shell Scripting. Apress. https://doi.org/10.1007/978-1-4302-1842-5_28

Download citation

Publish with us

Policies and ethics