try
awk 'BEGIN { FS="|"}
FILENAME=="code-desc.txt" { descr[$1]=$2 ; next }
{ for(i=1;i<=FS;i++) printf "%s|",descr[$i] ; printf "\n" ;} ' code-desc.txt datafile.txt
где
BEGIN {FS = "|"}
указывает awk использовать | как разделитель FILENAME == "code-desc.txt" {descr [$ 1] = $ 2; next}
при разборе code-desc.txt построить массив. обратите внимание:
Наиболее читабельный способ (IMHO) - использовать утилиту test
явно:
test -f ~/.ssh/config && echo -e "\xE2\x9C\x94 Config file existing"
Попробуйте это,
if [ -f ~/.ssh/config ]; then echo -e "\xE2\x9C\x94 Config file existing"; fi
или
[ ! -f ~/.ssh/config ] || echo -e "\xE2\x9C\x94 Config file existing"
или
[ -f ~/.ssh/config ] && echo -e "\xE2\x9C\x94 Config file existing"
и else
] должен быть последним
[ -f ~/.ssh/config ] && echo -e "\xE2\x9C\x94 Config file existing" || echo -e "\xE2\x9E\x97 No config file"