I have a script that wgets a .txt file and datifies the names.
I'd like to diff the changes between the newest & next-to-newest file.
This is how I am able to select them:
ls -t -l | awk '{print $9}' | head -n1 | tail -n1 | tr -d ' ' | xargs echo FIRST=
ls -t -l | awk '{print $9}' | head -n2 | tail -n1 | tr -d ' ' | xargs echo SECOND=
I wanted to use xargs to feed export to variables, and then simply do diff between them, like
diff $FIRST $SECOND
But the export part doesn't work because of the way xargs is.
I think my whole approach is wrong.