View Single Post
  #5   Report Post  
DoN. Nichols
 
Posts: n/a
Default HUGE sprinking can

In article ,
Tim Williams wrote:
"Bob May" wrote in message
...
Actually, the %20 is the proper way to handle the space character on the
web. Most websites accept either but some only accept the one.


Unfortunately DoN Just Can't Handle It :^)
(Or more accurately, li/u-nix.)


Well ... to be a bit more accurate, unix or linux can handle it,
the problem comes when trying to generate the filename on the command
line (to look at it with other programs). You see, unix shells use
spaces as one of the internal field separators (to separate multiple
command-line arguments). The other two are the TAB character and the
newline (end-of-line character). To get two words so separated accepted
as a single argument, you have three choices:

1) Enclose the pair of words in double quotes '"'

2) Enclose the pair of words in single quotes "'"

3) Prefix the space (or other offending character) with a '\'
to tell the shell "Yes, I know that this is a special character
which follows, but just for the moment, pretend that it is just
a plain character."

The OS itself only prohibits two characters in filenames, the
'/' which separates subdirectory names from filenames (and from each
other), and the NULL character (binary value of zero) which is used
internal to the OS kernel to terminate strings. This means that a
newline can be included in filenames, which can be used to create havoc
to certain automated scripts. :-)

Note that it is possible to make a minimal shell which treats
fewer characters as special, but they are so useful that it is worth
living with the inconvenience.

And some of the shells make it easier, such as tcsh (my
preferred interactive shell) which has filename completion -- you type
the beginning of the filename, and then hit a TAB, and it extends the
filename out as far as it can (two which are different in only the last
characters will let it extend out until the difference is reached, and
then wait for you to type a character to un-confuse it. (It will also
list the possible complete filenames to help you.) When it encounters a
space, tab, or newline in a filename, it will prefix it with a '\'.
Normally, I use this only once, and rename the file to something more
unix-friendly. :-)

And, of course, this is only important if I want to save the
file for later re-examination.

So -- now that you now know more than you ever wanted to about
unix behavior, I'll go back to reading the other articles. (I'm missing
quite a few, because my ISP's news server has had serious problems,
which will hopefully be fixed on Monday.)

Enjoy,
DoN.
--
Email: | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---