[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling filenames with spaces.



On Tue, 14 Mar 2000, Barrie Bremner wrote:

> 
>  As the title says, how do I deal with filenames that contain a space?
> 
>  I`ve tried using quotes, but I just get a `>` prompt.
 
You can use ' or " around any filename, but I normally just 'escape' iffy
charactors, as often I'm in the middle of typing a filename when I come
across one.  You can escape any char with \ infront of it.  Most shells* will
auto expand commands/environment variables/filenames when you hit a special
key.  Normally that key is Tab, but it can be changed and is sometimes escape
by default on other shells. 

So if I have a file called "this is a *" (sans quotes)
and no other files starting "thi" then once I type:

vi thi<Tab>

my shell (tcsh) displays:

vi this\ is\ a\ \*

I've noticed you always appear to use ` for your single quote (apostrophe)
which looks pretty weird.  Everyone else uses ' it means I don't even need to
glance up at the headers to see who an email is from, I can spot you
immediately :)

If you use `` around a command on a command the shell executes the command
and returns the STDOUT in to the command, here is a common example:

setenv LD_LIBRARY_PATH `pwd`

pwd returns /home/Damion/tmp for example, where I have just placed a library
I set my LD_LIBRARY_PATH to be /home/Damion/tmp with the command above so I
can then execute a binary that had a missing lib before.

Damion

*Even cmd.exe, if you search the registry for CompletionChar.

-- 
Damion Yates - Senior Internet Operations Engineer - Internet Services
email: Damion.Yates [at] bbc.co.uk - phone: +44 1737 839510

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.