ksh - need to replace a string from file1 to file2 -
ksh - need to replace a string from file1 to file2 -
hi all,
i have 2 files ft2
source , sqll.ksh
destination.
my need alter control=raja
control=kartik1
, etc others too.
kmariappan $ cat ft2.txt karthik1 karthik2 karthik3 kmariappan $ cat sqll.ksh sqlldr aja/raja123 control=raja log=ssed.log sqlldr aja/raja123 control=raja1 log=ssed.log sqlldr aja/raja123 control=raja2 log=ssed.log expected output sqlldr aja/raja123 control=karthik log=ssed.log sqlldr aja/raja123 control=karthik1 log=ssed.log sqlldr aja/raja123 control=karthik2 log=ssed.log
awk ' nr==fnr {name[nr]=$1; next} {sub(/control=[^[:blank:]]+/, "control=" name[fnr]); print} ' ft2 sqll.ksh
if you're satisfied it's working, add together end of command
> sqll.new && mv sqll.new sqll.ksh
ksh
Comments
Post a Comment