awk for join

Is it possible to do this with awk command??

sort1.txt

a    10
b    20

sort2.txt

a
b
c
d

join command

join sort1.txt sort2.txt && join -v1 sort2.txt sort1.txt

output

a    10
b    20
c
d

Thanx

---------- Post updated at 05:44 PM ---------- Previous update was at 05:35 PM ----------

I come up with this. working fine but still has some join command in it

gispc290 ~/Desktop
$ awk 'NR==FNR{_[$1]=$1;next}$1 in _{print _[$1],$2,$3}' sort2.txt sort1.txt && join -v1 sort2.txt sort1.txt

---------- Post updated at 05:58 PM ---------- Previous update was at 05:44 PM ----------

May be this

gispc290 ~/Desktop
$ awk 'NR==FNR{_[$1]=$1;next}$1 in _{print _[$1],$2,$3}' sort2.txt sort1.txt && awk 'FNR==NR{a[$1]++;next}!a[$1] {print $0}' sort1.txt sort2.txt

Please don't do that :cool:, if not you can win the Useless Use of Cat Award

Try

# awk 'NR==FNR{a[$1]=$2;next}{print $1,a[$1]}' sort1 sort2