Actually I would be curious how this function works at all!!
You have said:
Quote:
the problem is when I invoke the function as follows
find_client a.txt RBS15_SITE1
|
This would make:
$1 = a.txt
$2 = RBS15_SITE1
Therefore, based on your script:
Code:
find_client(){
res=`exec awk '/'"$1"'/ {print $1 }' a.txt |cat`
if [ $res = $2 ]; then
return 1
else
return 0
fi
}
This would mean that your awk is actually saying (after variable expansion):
Code:
res=`exec awk '/a.txt/ {print $1}' a.txt |cat`
Based on this I would say that res has the following string: #a.txt
I would also agree with irmin's last 2 questions as well???