linux - Redirecting output of cat to sort -
i have following problem: names of cities should accepted keyboard. list of cities should combined list of cities present in file cityfile. combined list should sorted , sorted output should stored in file newfile. have solve using pipelining. wrote following pipelines:
cat >> cityfile | sort > newfile sort | cat >> cityfile > newfile
how can pass data of cityfile sort command ?
the cat
command concatenates input. input can files or stdin. common key stdin "-". holds cat
command. do:
cat - cityfile | sort > newfile
you can find information man cat
.
Comments
Post a Comment