Questions

1:What combination of wildcards should you use to list all the files in the current directory that end in the form hwXYZ.ABC?

Here X and Y can be any number; Z is a number between 2 and 6; and A, B, and C are characters.

2:What action is performed by the following line, if the variable MYPATH is unset:
: ${MYPATH:=/usr/bin:/usr/sbin:/usr/ucb}
3:What is the difference between the actions performed by the command given in the previous problem and the action performed by the following command:
: ${MYPATH:-/usr/bin:/usr/sbin:/usr/ucb}
4:What is the output of the following command (figure it out by yourself before typing it into the shell):
echo $(( 3 * 2 + ( 4 – 3 / 4) ))

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition 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.