What's up with bash shell and spaces in filenames?

Michael Hannon jm_hannon at yahoo.com
Mon May 10 15:42:07 UTC 2010


Hi, Alan.  Are you sure that the spaces are causing the error?  I.e., if the directory were actually named:

    Media My Book

you'd get the behavior you describe.  I don't usually use spaces in file names, but I've never had a problem dealing with spaces (e.g., when I've gotten files with spaces in the names from other people).

-- Mike



----- Original Message ----
> From: Alan Evans <ame.fedora at gmail.com>
> To: fedora-list at redhat.com
> Sent: Mon, May 10, 2010 8:23:54 AM
> Subject: What's up with bash shell and spaces in filenames?
> 
> This is an on-again-off-again kind of problem. It usually hits me when
it is 
> least convenient, like when I only have shell access to the
machine. 
> Example:

[alan at agena ~]$ cd /media/My\ Book/
bash: cd: /media/My: No 
> such file or directory
[alan at agena ~]$ cd "/media/My Book/"
bash: cd: 
> /media/My: No such file or directory
[alan at agena ~]$ Gaaah!
bash: Gaaah!: 
> command not found

What's up with that? Usually it is no trouble, but 
> occasionally, bash
refuses to deal with spaces. I don't even know what to do 
> in this
case.
-- 
users mailing list

> ymailto="mailto:users at lists.fedoraproject.org" 
> href="mailto:users at lists.fedoraproject.org">users at lists.fedoraproject.org
To 
> unsubscribe or change subscription options:

> href="https://admin.fedoraproject.org/mailman/listinfo/users" target=_blank 
> >https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: 
> http://fedoraproject.org/wiki/Mailing_list_guidelines


      


More information about the users mailing list