Originally Posted by Tinkster
Out of curiosity: what WERE the results of those commands
of yours, what did you get in the file 'largest'? I would
have expected the last one to work.
Well the program won't allow me to tinker with its insides (it's basically a program where you write in the answer and won't let you do anything else). Anyway I made a file to try this out myself, within numbers I had:
And when I used 'sort -n numbers | sed -n 1p > largest' it ended up being exactly the same.
When I used 'sort -n numbers | sed -n 1p > largest' the result in 'numbers' was 8. So it seems that my sort command isn't working, which makes no sense to me as it looks fine. Any idea on what's wrong?
Originally Posted by johnsfine
I didn't think it needed further explanation.
Sort so the largest value is the last line. Pipe that to tail to copy just the last line to the destination file.
Sadly it seems I have an inherit need to make things as complicated as possible, I'll try that out.