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

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

问题描述

当我在 Unix 环境中运行特定的 SQL 脚本时,我在 SQL 脚本的每一行末尾看到一个^M"字符,因为它被回显到命令行.我不知道 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天全站免登陆