Java Reference
In-Depth Information
sequences is [: name :] where name is one of: alnum , alpha , ascii , blank ,
cntrl , digit , graph , lower , print , punct , space , upper , xdigit . The
phrase [:alpha:] matches any alphabetic character. The phrase [:punct:]
matches any punctuation character. We think you got the idea.
1.3.6.1
Of course there are always times when you want the special character to be just
that character, without its special meaning to the shell. In that case you need
to escape the special meaning, either by preceding it with a backslash or by en-
closing the expression in single quotes. The commands rm Account\$1.class
or rm 'Account$1.class' would remove the file even though it has a dollar
sign in its name (which would normally be interpreted by the shell as a vari-
able). Any character sequence in single quotes is left alone by the shell; no spe-
cial substitutions are done. Double quotes still do some substitutions inside
them, such as shell variable substitution, so if you want literal values, use the
single quotes.
Escape at Last
TIP
As a general rule, if you are typing a filename which contains something other
than alphanumeric characters, underscores, or periods, you probably want to
enclose it in single quotes, to avoid any special shell meaning.
1.3.7
Let's look at a directory of files. How do you know what's there? We can start
with an ls to list the names:
File Contents
$ ls
ReadMe.txt Shift.java dispColrs moresrc
Shift.class anIcon.gif jam.jar moresrc.zip
$
That lists them alphabetically, top to bottom, then left to right, arranged
so as to make the most use of the space while keeping the list in columns.
(There are options for other orderings, single column, and so on.)
An ls without options only tells us the names, and we can make some
guesses based on those names (for example, which file is Java source, and which
Search WWH ::




Custom Search