Passing Multiple shell variables to awk script doesn't work
echo $jdbc_url
echo $v_Password
echo $jdbc_url
awk -F"=" -v awk_v_SchemaName=$v_SchemaName -v awk_v_Password=$v_Password -v awk_jdbc_url=$jdbc_url '{
if ( $1 == "jdbc.url" ) {
print awk_jdbc_url
}
else if ( $1 == "jdbc.username" ) {
print awk_v_SchemaName
}
else if ( $1 == "jdbc.password" ) {
print awk_v_Password
}
else {
print $0
}
}' file_name >> file_name_modified
why does it print blank for awk_v_SchemaName, awk_v_Password? though echo statements on top of awk command prints assigned values
Any alternative do I have? This is hell irritating with awk, something work, something doesn't... lot many times I waste time on it and finally apt other approaches
Please help me if possible
Last edited by ripudaman.singh; 08-27-2014 at 04:43 AM.
|