department.txt contains column as ID, Department
I am using below to change the order to Department,ID
But if i further update the command to below
Then department.txt becomes empty, without any output. If i use some other file instead of the same file which i am reading, then it works.
I understand i am reading and updating the same file, but as per my understanding is | should take care of it, as internally it must be storing the the output somewhere in its memory and dumping it in the file which i have asked. Isnt it ? Can someone throw some insight on how it works ?
Note: I know there are many similar questions, but none of them have really answered how internally |
works, which is the fundamental question for which i need an answer.
department.txt
, output isdepartmet.txt
(non
). – Barmar Apr 07 '18 at 06:39