file.txt
file format = cust:hdb
file data = ted Ref:4rm
read -p “Cust:” cust
User key in: ted ref
grep -i -q "$cust" "file"
System able to ignore case and read the input
read -p "NewCust:" cust2
User key in: Ted Ref
awk -F : -v OFS=: -v cust=”$cust” -v cust=”$cust2″ -v hdb=”$hdb”
‘$1==cust && $2==hdb {$1=cust2;}1’ file
How do i set this so that the awk can ignore the case and update to file?
In addition to
IGNORECASE, you can convert the item you are matching to lowercase inGNU awkwithtolower().The GNU awk documentation offers this page on case sensitivity.