-4

Anyone please explain the following output..enter image description here cattmp.3

2
cat<tmp.1|wc>tmp.3

This is the same as

wc <tmp.1 >tmp3

It will count the number of words, lines and bytes in tmp.1 and write the result to tmp.3. This command line produces no output on the terminal when run in this way.

The other output saying Done is from an earlier invocation of ls that was run as a background job (started as ls ... &). That job finished just as you ran the wc command, and the shell reported that it had done so.


Judging from this question and from your previous question, you seem to run odd commands as background jobs. Don't do that. Simply don't run commands with & appended to the end if you don't need to run them as asynchronous processes.

Look for a tutorial on-line that explains job control in bash, or read the questions here.

1
cat<tmp.1|wc>tmp.3

This counts the bytes in tmp.1, writing the result into tmp.3 and printing nothing. It is equivalent to

wc <tmp.1 >tmp.3

or

<tmp.1 wc >tmp.3

The output that you see printed, that is:

[3] Done         ls --color=auto -al | wc

is the shell telling you that a previous command you had run in the background (with &) has completed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.