Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Expressions > Dollar Sign Substitutions

Dollar Sign Substitutions

The dollar sign is used for more than variable substitution. There are a variety of dollar expansions, some substituting string values and others mimicking capabilities of Linux commands such as wc and sed. By using the dollar sign expressions, the shell doesn't have to start these programs and will run faster.

ANSI C Escape Expansion ($')

If a dollar sign is followed by a string in single quotes, the string is searched for ANSI C escape sequences and the sequences are replaced by the corresponding characters. The acceptable escape sequences are similar to the special format escape codes used by the printf command:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint