Chapter 5

  1. By using ((:
#!/bin/bashnum=$(( 25 - 8 ))echo $num
  1. The problem is with the space in the filename. To fix it, put the filename between quotes:
$ rm "my file"
  1. There is no dollar sign before the parentheses:
#!/bin/basha=$(( 8 + 4 ))echo $a

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.