47.5 Using C Shell ArraysThe C shell can treat its shell variables as word lists . They're a lot like arrays (52.9 ) in other programming languages, so that's what I'll call them. The C shell's path (6.5 ) , cdpath (14.5 ) , and mail (21.8 ) shell variables are arrays, for example. By the way, arrays are great for storing information in your shell setup files (2.2 ) . 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: %
A dollar sign ( % Like the Bourne shell shift (44.17 ) command, the C shell shift command shifts the command-line arguments. It also shifts array members. Let's shift the job array: % Tom Christiansen told me that putting your directory stack (14.6 ) in an array is really useful. He's right. You might add an alias (10.2 ) for pushd and popd that stores the dirs output into an array named dirs : alias pushd 'pushd \!* && set dirs=(`dirs`)' alias popd 'popd \!* && set dirs=(`dirs`)'
Then, to look in the third directory in your stack, use a command like
- |
|