行尾有'^ M'字符 [英] '^M' character at end of lines

查看:92
本文介绍了行尾有'^ M'字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Unix环境中运行特定的SQL脚本时,我在该SQL脚本的每一行的末尾看到一个'^ M'字符,因为它回显了命令行.我不知道最初在哪个OS上创建SQL脚本.

When I run a particular SQL script in Unix environments, I'm am seeing a '^M' character at the end of each line of the SQL script as it is echoed to the command-line. I don't know on which OS the SQL script was originally created.

是什么原因造成的,我该如何解决?

What is causing this and how do I fix it?

推荐答案

这是由DOS/Windows行尾字符引起的.就像安迪·惠特菲尔德(Andy Whitfield)所说的那样,Unix命令dos2unix将帮助解决该问题.如果需要更多信息,可以阅读该命令的手册页.

It's caused by the DOS/Windows line-ending characters. Like Andy Whitfield said, the Unix command dos2unix will help fix the problem. If you want more information, you can read the man pages for that command.

这篇关于行尾有'^ M'字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆