Re: listing files with spaces, using wildcard

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

 



On Friday 20 February 2009 01:44:27 bruce wrote:
> hey...
>
> here's one i can't see..
>
> goat a bunch of files in different dirs.. the files might have spaces
>
>  1foo_ aa_bb_cc.dog
>  2foo_aa_bbbb_cc.dog
>  3foo_aa_bb _ccc.dog
>  4foo_aa_bb_cc.dog
>  5foo_aa_bb_cc.dog
>  6foo_aa_bb_cc.dog
>
> i'm trying to figure out how i can do a complete list of all files with
>  *foo*dog
>
> so i get the files with spaces and underlines...

Depends a little on what you want to do with the list :o)

If you need it quoted, something like:

    for file in *foo*.dog ; do
        echo "\"$file\""
    done

might help you, but that'll still fail horribly if there are any embedded quotes 
in the files. I see someone's already replied with the find ... -print0 method.

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux