1.回车换行符 chr(10)是换行符,chr(13)是回车, 增加换行符 select ' update ' || table_name || ' set VALID_STATE =''0A'';'||chr(13)||' commit;' from user_tables 删除换行符 select id,replace(content,to_char(chr(13))||to_char(chr(10)),'_r_n') from fact_content order by co
假设 str="a,b,c,d" echo ${str} | sed "s/,/\n/g" 输出: a b c d echo ${str} | sed "s/,/\n/g" | sed "s/\n/,/g" 输出: a b c d 没有匹配到\n换行符 这是因为sed 模式是以\n换行符作为行的结束标记的.它没有办法匹配到\n再替换 解决方法: echo ${str} | sed "s/,/\n/g" |