O'Reilly logo

Linux Shell Scripting with Bash by Ken O. Burtch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Text File Basics

A text file is a file containing human-readable text. Each line ends with a line feed character, a carriage return, or both, depending on the operating system. By Linux convention, each line ends with a line feed, the \n (newline) character in printf.

The examples in this chapter use a text file that lists several pieces of furniture by name, price, quantity, and supplier number, as shown in Listing 11.1.

Example 11.1. orders.txt

 Birchwood China Hutch,475.99,1,756 Bookcase Oak Veneer,205.99,1,756 Small Bookcase Oak Veneer,205.99,1,756 Reclining Chair,1599.99,1,757 Bunk Bed,705.99,1,757 Queen Bed,925.99,1,757 Two-drawer Nightstand,125.99,1,756 Cedar Toy Chest,65.99,1,757 Six-drawer Dresser,525.99,1,757 Pine Round Table,375.99,1,757 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required