|
|
|
| |||||||||
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SED command against multiple files
I have multiple files in one directory starting with POS. ex. POS123.date
POS345.date I want run a sed command script I already have created. What is the command to use to do this? This will be in a script and there will be multiple files in this directory beginning with POS. The command I usually use if I only have one file is: sed -f sed.867 $DATAPATH/867.txt > $DATAPATH/867.sed I still want the output to be each individual POS*.date file. Bman79 |
|
#2
|
|||
|
|||
|
make a loop
Code:
for file in POS* do newname=`echo $file|sed -e 's/txt$/sed/'` sed -f sed.867 $file >$newname done |
|
#3
|
|||
|
|||
|
apropos bman79
how long will you ask the same question ? |
|
#4
|
|||
|
|||
|
I don't understand? 'How long will I ask the same question?'
This is the first time I have asked this question. Thanks for the reply, I will add this to the script and test. Thank you. |
|
#5
|
|||
|
|||
|
re-read your ' Unix Scripting Question ' thread
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > SED command against multiple files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|