cat files from pipe

1

I have to join files to one original file, which was split. There is a catalog, in which there are a lot of files,but no every is necessary. I have file with md5sum, which contain md5sum files I have to join.

join -1 1 -2 1 tmp sumpos | sort -k2,2 | cut -d ' ' -f 3 | tr '\n' ' ' | xargs cat > result

tmp - sorted md5sum sumpos - sorted md5sum which I found in the catalog

It is a task from studies and I think our lecturer don't want to xargs here, so is a way to do this without xargs?

diego9403

Posted 2016-05-28T16:54:04.880

Reputation: 807

Answers

0

If you just drop the last pipe, xargs and cat it should work. It would look like this:

join -1 1 -2 1 tmp sumpos | sort -k2,2 | cut -d ' ' -f 3 | tr '\n' ' ' > result

Mikael Kjær

Posted 2016-05-28T16:54:04.880

Reputation: 1 318

No there are only names of the files. – diego9403 – 2016-05-28T17:33:13.803

Try to add | cat - right before > result – Mikael Kjær – 2016-05-29T02:21:58.013