![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to perform some actions on multiple files | heprox | AIX | 2 | 06-12-2006 12:31 PM |
| Script to delete all data from multiple files | uni_ajay_r | Shell Programming and Scripting | 5 | 03-29-2006 08:05 AM |
| Need a script to delete multiple files | navycow | UNIX for Dummies Questions & Answers | 3 | 01-16-2006 11:50 AM |
| Combining Multiple files in one in a perl script | rahulrathod | Shell Programming and Scripting | 1 | 12-17-2005 10:51 PM |
| What are core files and how can I delete them when am performing system maintenance?? | IMPORTANT | UNIX for Dummies Questions & Answers | 6 | 04-04-2002 12:39 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Performing Script on Multiple Files
Dear All
I have group of files named : CDR.1,CDR.2.,CDR.3,CDR.4,CDR.5,CDR.6,etc....... I am performing an awk command look like this : nawk -f script CDR.* What i want is that i want to perform this command on range of files not all of them. Instead of writing CDR.* i want to write from CDR.1 to CDR.3. Please Advise Best Regards Zanetti |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Try CDR.[1-3]
|
|
#3
|
|||
|
|||
|
Handle three at a time, for as long as there are any left?
Code:
echo CDR.* | xargs -n 3 nawk -f script |
|
#4
|
||||
|
||||
|
Hi.
The order of the files produced by the shell may not be what you expect, so use caution if the order is important. For example: Code:
#!/bin/bash3 -
# @(#) s1 Demonstrate list sequence from shell for numeric sub-strings.
echo
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version =o $(_eat $0 $1)
echo
# Manufacture the list, and remove previous debris.
LIST=$( printf "t%d " {5..12} )
rm -f $LIST
# Create the files.
touch $LIST
echo ' Results from echo t*:'
echo t*
exit 0
Code:
% ./s1 (Versions displayed with local utility "version") Linux 2.6.11-x1 GNU bash 3.00.16(1)-release Results from echo t*: t10 t11 t12 t5 t6 t7 t8 t9 |
||||
| Google The UNIX and Linux Forums |