© David Both 2020
D. BothUsing and Administering Linux: Volume 2https://doi.org/10.1007/978-1-4842-5455-4_9

9. Command-Line Programming

David Both1 
Raleigh, NC, USA


In this chapter you will learn
  • A definition for command-line programs

  • To create Bash command-line programs

  • To use logical comparisons to alter the execution path of command-line programs

  • To use “for” loops to iterate over a code segment a specified list of items

  • To use “while” and “until” to loop over a portion of code a specified number of times.


We have already used command-line programs in earlier chapters of this course. Those were all fairly simple and straightforward with simple requirements. There are many times when SysAdmins create simple command-line programs ...

Get Using and Administering Linux: Volume 2: Zero to SysAdmin: Advanced Topics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.