RE: wildcards to list a group of files in sequential numerical order ?

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

 



________________________________________
From: users-bounces@xxxxxxxxxxxxxxxxxxxxxxx [users-bounces@xxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of linux guy [linuxguy123@xxxxxxxxx]
Sent: Monday, November 07, 2011 12:28
To: Community support for Fedora users
Subject: wildcards to list a group of files in sequential numerical order ?

I'd like to list all the files with names between DSC_6035.NEF  and
DSC_6072.NEF.

How do I do this ?

I tried using DSC_[6035-6072].NEF, but that doesn't work. It lists
files outside the desired range.   The [  ]  operator needs just 1
character parameter to work properly ????

________________________________________

Not sure that shell globbing will work here... but you could do something like this in bash:

start=6035
end=6072

list_files()
{
   n=$1
   while [ $n -le $2 ]; do
     f=DSC_${n}.NEF
     [ -f ${f} ] && echo $f
     n=$(($n + 1))
  done
}

ls `list_files $start $end`
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux