- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Control chars displaying while doing a vi
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 02:28 PM
03-01-2001 02:28 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 02:38 PM
03-01-2001 02:38 PM
SolutionTo get rid of those ^M characters run your file through the dos2ux utility
# dos2ux filename > newfilename
The reason you see the ^M is because of the difference in the way Windows handles the en-of-line character. In Windows, it is actually comprised of two characters a carriage return (CR) followed by a line feed (LF), whereas in Unix the end of line character is simply a LF.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 07:02 PM
03-01-2001 07:02 PM
Re: Control chars displaying while doing a vi
...And if you forget to run dos2ux before executing vi, do this last line mode command:
:%s/^m//
It substitutes the ^m on each line with nothing. To get the ^m into vi, press the ctrl key and hold it down. Then press the v key, release, then the m key, release the m and then the ctrl key. This ^v trick will work for any control character you wish to embed into your document.
--Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2001 04:13 AM
03-02-2001 04:13 AM
Re: Control chars displaying while doing a vi
#!/bin/ksh
# myscript
cat $1 | tr -d "\015" > ${1}.no_em
mv ${1}.no_em ${1}
The \015 is octal for the control-M. tr is the transliterate command.
Steve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2001 06:29 AM
03-02-2001 06:29 AM
Re: Control chars displaying while doing a vi
Hope this helps...
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2001 08:58 PM
03-02-2001 08:58 PM
Re: Control chars displaying while doing a vi
Please use dos2ux command to convert dos file to unix file
#dos2ux dosfile > unixfile
Thanks