The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.
What is the functional difference between single quotation marks and double quotation marks when assigning values to variables?
What special character causes the value of a variable to be substituted?
How do you test for the existence of a directory in an if..then statement?
In the statement for MYVAR in a b c d e; do, which begins a for..do loop, what values will the variable MYVAR hold?
What do the caret (^) and dollar sign ($) characters do when used in a sed command?
When a value is assigned in single quotation marks (''), variable and command substitution are not performed even if a dollar sign ($) appears in the value. When a value is assigned in double quotation marks (""), variable and command substitution are performed before the value is assigned the variable.
The dollar sign ($).
if [ -d directory ]; then, where directory is the name or path of the directory you want to test for.
The commands inside the loop will be executed five times. The values of MYVAR each time through the loop will be "a", "b", "c", "d", and "e", in that order.
The caret matches the beginning of a line; the dollar sign matches the end of a line.
Experiment with quoting and assigning values to variables and then expand them using the echo command. Do this until you feel familiar with the way variable assignment and substitution work.
Study the final listing of the lxprint command until you feel confident that you understand how every line in it works.
Try modifying the lxprint script to make sure that when the user passes a filename as an argument, it is a .tex file and not some other kind of file. (Hint: There are at least two ways to modify the script, both using command substitution and an if..then statement; one uses the grep command and the other uses sed.)