Well in answer to your question why the awk script failed, this is because of a simple typo:
Code:
awk '{current = $NF;getline; if($NF == current)print "match";else print "mismatch"}' file
However, it would not have worked anyway as your input shown in the last post has no white space and is delimited by a dash (-)
So based on that, the following would be the small change required:
Code:
awk -F"-" '{current = $NF;getline; if($NF == current)print "match";else print "mismatch"}' file
I would mention, and of course it is your prerogative, but it is unusual to write a (ba)sh script that then calls a ksh script, especially when you try to include
it within a function:
Code:
DBcounttry_finalfunction()
{
#!/bin/ksh
I am not even aware that this would work as my understanding is the interpreter needs to be the first line (I could be wrong).
Is there a reason for the mash up? On a quick scan there does not appear to be anything particularly ksh specific that required this?
Anyhoo, let me know how you get on.