The basic file "list" command. It is all too easy to
underestimate the power of this humble command. For example,
using the -R, recursive option, ls provides a tree-like listing
of a directory structure. Other useful options are -S, sort
listing by file size, -t, sort by file modification time, -b,
show escape characters, and -i, show file inodes (see Example
15-4). The ls command returns a non-zero exit status when
attempting to list a non-existent file. Example 15-1. Using ls
to create a table of contents for burning a CDR disk #!/bin/bash
# ex40.sh (burn-cd.sh) # Script to automate burning a CDR.
SPEED=10 # May use higher speed if your hardware supports it.
IMAGEFILE=cdimage.iso CONTENTSFILE=contents # DEVICE=/dev/cdrom
For older versions of cdrecord DEVICE="1,0,0" DEFAULTDIR=/opt #
This is the directory containing the data to be burned. # Make
sure it exists. # Exercise: Add a test for this. # Uses Joerg
Schilling's "cdrecord" package: #
http://www.fokus.fhg.de/usr/schilling/cdrecord.html # If this
script