On Feb 20, 10:20 am, Robert Citek <[email protected]> wrote:
> On Fri, Feb 19, 2010 at 11:16 PM, Dos-Man 64 <[email protected]> wrote:
> > Does traditional Unix allow spaces in file names?
>
> Yes.  IIRC, the only character you cannot have in a name is the
> forward slash.  Spaces, newlines, backspaces, tabs, etc. are all valid
> filename characters.  However, I couldn't find a man page to confirm
> this.
>
> > What is the best way to deal with these kinds of file names?
>
> You need to "escape" the special characters or use quotes (single or
> double).  For example:
>
> $ cp "MY DATA.TXT"  "MY DATA.BAK"
> $ cp 'MY DATA.TXT'  'MY DATA.BAK'
> $ cp MY\ DATA.TXT  MY\ DATA.BAK
>
> $ to="MY DATA.TXT" ; from="MY DATA.BAK"
> $ cp "$to" "$from"
>
> Good luck and let us know how things go.
>
> Regards,
> - Robert

Thanks, I thought I read somewhere that either Unix or Linux files
can't have spaces in the names, but it's one of those things where you
can't remember what you read or where you read it.

My main book for learning the basics and rules over the years has been
"Learning Unix" by James Gardner.  It comes with some handy software
that lets you pretend you are in unix from an ms-dos command prompt. I
used to practice all the time back when linux was still impossible to
install and configure :D

I've got other books, but they tend to drift off into extraneous
territories. I learned most of the basics from Gardner.

-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup

Reply via email to