Hi All,
Below codes will print the messages for each of unmatched records. How to correct it to print only one 'Not Found' message at the end of a file if the word is not found?
#-------- Script --------
read string?'[Enter the old name]: '
awk '{ if ( $1 == word )
print "[ The new name is]: " $2
else print " Not FOUND!"
}' word="$string" $HOME/old_new.txt
Thanks,
Mike
Below codes will print the messages for each of unmatched records. How to correct it to print only one 'Not Found' message at the end of a file if the word is not found?
#-------- Script --------
read string?'[Enter the old name]: '
awk '{ if ( $1 == word )
print "[ The new name is]: " $2
else print " Not FOUND!"
}' word="$string" $HOME/old_new.txt
Thanks,
Mike