The C shell can treat its shell variables as word lists. They're a lot like in other programming languages, so that's what I'll call them. The C shell's , , and shell variables are arrays, for example. By the way, arrays are great for storing information in your .
To set an array, use parentheses around the value. Put a space between array members. Inside the parentheses, you can use single quotes, backquotes, double quotes, and so on. Here's how to put fix the report in the first member of the job array and resign as the second member:
set job=("Fix the report" resign)
A dollar sign (
$) before the name of a shell variable gives
you its value.
That gives all members of an array, too, because the array is
stored as a shell variable.
To pick out a particular member, put its number in square brackets
after the name.
echo $jobFix the report resign %
echo $jobFix the report
Then, to look in the third directory in your stack, use a command like
Or, use an array with a
to step through the members one-by-one.
For instance, you might need to find the file frobozz that
you put in some directory in your stack.
to look for a file that exists: