So here I have the following code:
#!/bin/bash
awk \'BEGIN {f=4} {printf($f\" \"); f=f-1}\'
Which will take input such as:
awk '!i{i=NF}{printf "%s ",$i;i--}'
EDIT: Since Ed has already exploited all the nice and proper awk solutions I'll throw in a native bash solution:
$ cat t.sh
#!/bin/bash
while read -ra numbers; do
: ${i:=${#numbers[@]}}
diag+=("${numbers[--i]}")
done < test.txt
echo "${diag[@]}"
.
$ ./t.sh
4 7 1 4