Skip to Content
Learning Linux Shell Scripting
book

Learning Linux Shell Scripting

by Ganesh Sanjiv Naik
December 2015
Beginner
306 pages
5h 2m
English
Packt Publishing
Content preview from Learning Linux Shell Scripting

Chapter 6. Neat Tricks with Shell Scripting

In the last chapter, you learned about shell and environment variables. You also learned about how to export environment variables, read-only variables, command-line arguments, and create/handle arrays.

In this chapter, we will cover following topics:

  • Interactive Shell scripts and reading from the keyboard
  • Using the here operator (<<) and here string (<<<)
  • File handling
  • Enabling debugging
  • Syntax checking
  • Shell tracing

Interactive Shell scripts – reading user input

The read command is a shell built-in command for reading data from a file or keyboard.

The read command receives the input from the keyboard or a file until it receives a newline character. Then, it converts the newline character into a null character: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Linux Shell Scripting - Second Edition

Learning Linux Shell Scripting - Second Edition

Ganesh Sanjiv Naik

Publisher Resources

ISBN: 9781785286216