I'm trying to join one standard input with an unsorted file, let's say:
awk '{print $1}' somefile | join /dev/stdin unsortedfile
Is it possible to sort the file "at the moment" instead sorting it, saving it and subsequently using it in join? I was thinking about something like
export SORT = `sort unsortedfile`; awk '{print $1}' somefile | join /dev/stdin $SORT
but it doesn't work, it says "SORT : command not found". I'm new to variables, so I'm not sure they are what I am looking for.
If it can be useful, I'm using cygwin.