The
system function executes an external command and returns the
error level. basename happens to print to standard output, so you see the basename of the file in the terminal, but awk gets back only the error level (0 is success), which it puts into the printf placeholders, thus the output you see.
On a broader note, calling external commands should be kept to a minimum because each invocation is expensive. If you're going to have more than a few lines in this file, that's a lot of processes being created, and your program will be slow and un-reliable.
Much better would be to do the basename function internally.
Code:
awk -F'|' 'function bn(p) { n=split(p,a,"/"); return a[n]; } { printf("%s|%s\n", bn($1), bn($2)); }'
If you are doing this in the middle of a shell script, there's no need even to invoke awk - the shell can do this processing easily enough
Code:
IFS="|"
while read f1 f2; do
echo "${f1##*/}|${f2##*/}"
done < 4geList
Note that if you want to retain the original IFS value, you can enclose this section in parenthesis - it will then be executed in a sub-shell and prevent modification of the original IFS value.