![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Comparing files enen when they are not in order | ragavhere | Shell Programming and Scripting | 2 | 06-04-2008 05:13 PM |
| Order files by create date | mab_arif16 | Shell Programming and Scripting | 4 | 05-15-2006 01:04 PM |
| Adding files of numerical data | Boucho | High Level Programming | 17 | 02-07-2006 04:29 PM |
| lp - order of files printed | mabrownawa | UNIX for Advanced & Expert Users | 2 | 02-16-2004 12:08 PM |
| Recursive directory listing without listing files | psingh | UNIX for Dummies Questions & Answers | 4 | 05-10-2002 10:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Listing files in numerical order
Hi, I'm trying to write a ksh script to copy a specified number of files from one directory to another.
The files are named in the convention <switchname>_log.<num> and the numbers are sequential single digit onwards. I figured I could find some parameter for ls which would list the files in correct order but having searched high and low i cannot figure this one out. I consistently get - <switchname>_log.1 <switchname>_log.10 <switchname>_log.11 <switchname>_log.12 <switchname>_log.13 <switchname>_log.14 <switchname>_log.15 <switchname>_log.16 <switchname>_log.17 <switchname>_log.18 <switchname>_log.19 <switchname>_log.2 <switchname>_log.20 etc. I want to do a couple of things - firstly I want to write a script which moves the first numerically sequenced file from the directory, I will then put this in some sort of loop so it does it every 5 minutes for each of 12 directories. Secondly I want to to be able to do this as a one off taking the first X number of each switch's files to copy elsewhere. HELP PLEASE! |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|