I have a variable whose value is found using sql query.
I want to remove the new line character from that variable since I want to concatenate this variable with the other. Below is the code:
dt=`sqlplus -s user/pwd@servicename <<EOF
set feedback off;
set head off;
select replace(to_char((sysdate-7),'YYYYMonDD')||'_'||to_char((sysdate-1),'YYYYMonDD'),chr(10), '') from dual;
exit;
EOF`
echo "test $dt"