1846575 Members
2063 Online
110256 Solutions
New Discussion

Re: unix script

 
ian walker_1
Advisor

unix script

I have ten files, each with output of diff command, e.g.

110a111
> ./dir1/filename
> ./dir1/filenameB
178a190
> ./dir1/subdir/filename
> ./dir1/subdir/filenameB

I want to check each of these files, and essentially copy all the files to an "old" area and then remove them. Each of the ten files need to produce a separate output file.

Any clues of what script to fit this?

2 REPLIES 2
Jean-Luc Oudart
Honored Contributor

Re: unix script

Hi

you don't say much about the output filename (how to recognize them !).
Also, instead of copy and delte why not move them ?

for fln in $(ls *.diff_out)
do
mv $fln $DEST/.
done

DEST is a vaiable for the target directory

Regards
Jean-Luc
fiat lux
ian walker_1
Advisor

Re: unix script

found answer myself through trial and error