Is there a way to use "sort -o" without a pipe?

C

CrazedNerd

Guest
The -o argument is useful because you can turn the program's output into a file for use later. The way i've found you can use this is like:

Code:
<some-input> | sort -o <new-file-name>

however, i wonder if there is a tried and tested way of using sort like this without the pipe?
 


Code:
[joe@dig ~]$ cat file
masked
hello
goodbye
newday
tomorrow

[joe@dig ~]$ sort file > file.sorted
[joe@dig ~]$ cat file.sorted 

goodbye
hello
masked
newday
tomorrow
 
Code:
[joe@dig ~]$ cat file
masked
hello
goodbye
newday
tomorrow

[joe@dig ~]$ sort file > file.sorted
[joe@dig ~]$ cat file.sorted

goodbye
hello
masked
newday
tomorrow
i meant with the -o but that itself is pretty obvious i guess...
 

Members online


Top