R is easy to script and I often use it for small jobs simply because it's easy to use. I prefer to re-use tested code rather than over-think easy problems. I prefer:
over
Code:
set n=`wc input_file` && sort -n input_file | awk '{if(NR==(N+1)/2) print }' N=$n[1]
There is also the added advantage that I know R correctly handles lists with an even number of elements. With ad-hoc solutions (solutions not included in a distributed program or library) I would first have to read / understand the code to be sure that it operated correctly.
If R is simply too much effort, I would also recommend googling for numpy, which can also calculate the median. I didn't think of it last night when I wrote my original reply. Since it is a python library, it might appeal more to people who believe R is too difficult to script (although I don't understand this at all). There is probably something similar for perl but I don't know perl very well.
EDIT: Regarding the thread referred to by ahmatti, I find it interesting that most of the responses are examples of how to use R to do the same thing.

But, I want to thank ahmatti for posting this thread here, because I have now learned about the "little r" program, which is designed to help you use R in a bash script. The number of uses to this little trick are incredible.
Bookmarks