The cat a.t xt | sort & gt; A.t xt
The didn't like me to do a.t xt files in good order, and write again a.t xt, instead is empty in the a.t xt
I find this code, it is capable of achieving the goal:
The cat a.t xt | echo | sort & gt; A.t xt
I wonder why, but baidu, hope leaders help solve
CodePudding user response:
Sorry, the cat a.t xt | echo | sort if doesn't workCodePudding user response:
Can't be the same fileCodePudding user response:
The shell when parsing the command to initialize the pipes, so & gt; A.t xt file first emptied, the cat at less than content at this time,So to change the source file, cannot use pipes,
If the pipe, can use a temporary file transfer