How to remove carriage return and newline from a variable in shell script

前端 未结 6 1802
挽巷
挽巷 2020-12-01 05:57

I am new to shell script. I am sourcing a file, which is created in Windows and has carriage returns, using the source command. After I source when I append som

6条回答
  •  无人及你
    2020-12-01 07:02

    Pipe to sed -e 's/[\r\n]//g' to remove both Carriage Returns (\r) and Line Feeds (\n) from each text line.

提交回复
热议问题