Search Results

Search: Posts Made By: foracoffee
1,695
Posted By Corona688
Ah. That could also have been remedied with awk...
Ah. That could also have been remedied with awk -F"/" 'NR==FNR '{ A[$NF]++; next } $NF in A'
1,695
Posted By Corona688
I misplaced a quote, sorry. The awk code...
I misplaced a quote, sorry.

The awk code doesn't create a file, the find code does.
find /path/to/root > allfiles

awk -F"/" 'NR==FNR { A[$1]++; next } $NF in A' filelist allfiles | while read...
1,695
Posted By Corona688
find /path/to/root > allfiles awk -F"/"...
find /path/to/root > allfiles

awk -F"/" 'NR==FNR '{ A[$1]++; next } $NF in A' filelist allfiles | while read LINE
do
echo cp "$LINE" /path/to/dest
done

rm allfiles
75,883
Posted By futurelet
BEGIN { out_file = "junk2" print "line 1"...
BEGIN {
out_file = "junk2"
print "line 1" >out_file
print "line 2" >out_file
}
75,883
Posted By cordobapab
awk -f script.awk inputfile > outputfile ...
awk -f script.awk inputfile > outputfile

Well... you just use the ">" sign in order to direct the output to an output file.

Pablo.
20,975
Posted By vino
find . -name Results*.dat -exec cp {}...
find . -name Results*.dat -exec cp {} /destination/dir \;

Read the man page for -exec

vino
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 05:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy