DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th July 2008
Weaseal's Avatar
Weaseal Weaseal is offline
Package Pilot
 
Join Date: May 2008
Location: East Coast, US
Posts: 177
Thanked 7 Times in 7 Posts
Default Moving files

I have a bunch of photos in the naming scheme 100_0001.jpg, 1000_002.jpg, etc. how would i do something like move 1000_432.jpg through 100_789.jpg to a different folder without specifying each one individually?
__________________
FreeBSD addict since 4.2-RELEASE.
My FreeBSD wiki.
Reply With Quote
  #2   (View Single Post)  
Old 14th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

You can probably make use of the shells globing features to only operate on the desired range.


Me I would just try to use Perl to loop over the range and move() them, out of instinct.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #3   (View Single Post)  
Old 14th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Perhaps:
% mv $(ls 1000_*.jpg | sed -n -e '/432/,/789/p') /path/to/destination/folder
It should work, untested though.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving ZFS to a other pool? amscotti Solaris 1 28th July 2009 11:49 PM
Moving to ZFS Business_woman FreeBSD General 6 20th October 2008 03:28 PM
Moving ZFS partitions/drives between systems corey_james Guides 2 6th August 2008 08:36 PM
Moving FreeBSD to new PC? cwhitmore FreeBSD General 23 22nd July 2008 02:59 PM


All times are GMT. The time now is 03:11 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick