LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sorting a file with a variable name (https://www.linuxquestions.org/questions/linux-newbie-8/sorting-a-file-with-a-variable-name-888620/)

juliamarie 06-27-2011 01:49 PM

Sorting a file with a variable name
 
I am trying to sort a file, so I can compare it to another file later.
I am storing the file name in a variable called curMo.
I then call sort $curMo and it hangs for a very long time and I have to quit the process.
Any idea why this is not working or how to make it work?
Here is part of my code:

#sort this file for this Location
sort -u $curMo -o $curMo.sorted

Thank you!

anomie 06-27-2011 01:56 PM

Read the manpages for sort(1). You have the right idea, but are invoking it incorrectly.

Code:

$ sort -u -o ${foo}.sorted ${foo}


All times are GMT -5. The time now is 12:09 AM.