As I've stated before, there are redundancies in my scripts, but they force
me to check the order of the columns in the original files.
That is what help messages are for:
#!/bin/sh
if [ -z "$3" ]
then
printf "Usage: $0 PRT_list IPv4_addresses output_dir
Both files must have two fields. The first field must be the PTR and must
unique in PTR_list.
"
exit
fi
mkdir -p "$3"
sort -u "$2" | awk -v out="$3/" 'FILENAME == ARGV[1] { a[$1] = $2 } FILENAME
== ARGV[2] && $1 in a { print $2 >> out a[$1] "," $1 }' "$1" -
Also, you can write comments after "#". Writing 'join -a 1 -1 1 -2 1' rather
than only 'join', one expects the options to have a purpose.