Hi,
I am currently studying the ">" and ">>" tools for output redirection. I have a file, eleves.txt, in which some lines a repeated. My goal is to sort them out. For this, I want to use the sort command. In a terminal, I have written:
Code:
sort eleves.txt > eleves.txt
Now I know that, using the ">" tool for output redirection, if the file already exists, it will be overwritten. My problem is that when I type
in the terminal (after having sorted the file a redirected the output to the same file), all data from eleves.txt seems to have disapeared. I was expecting the files to have all its lines sorted instead. Please help me understand this behaviour...
Bookmarks