FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 11-07-2011, 04:28 PM
linux guy
 
Default 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 ????

Thanks !
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 11-07-2011, 05:29 PM
"Miner, Jonathan W (US SSA)"
 
Default wildcards to list a group of files in sequential numerical order ?

________________________________________
From: users-bounces@lists.fedoraproject.org [users-bounces@lists.fedoraproject.org] On Behalf Of linux guy [linuxguy123@gmail.com]
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@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 06:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org