- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to search and replace ^M in 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
Discussions
Discussions
Discussions
Forums
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
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
тАО04-14-2002 07:00 PM
тАО04-14-2002 07:00 PM
I have file in hp unix box , for comvenience, I ftp to window, edit it , and ftp it back to unixbox, i find ^M appear in the end of each line, how delete it in vi?
another question : if the vi said the line is too long for edit and does not display for edit, what to do?
Thanks
Sunny
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2002 07:21 PM
тАО04-14-2002 07:21 PM
SolutionThere are special tools for converting files
from Unix to DOS and back again. They
are 'dos2ux' and 'ux2dos'
There is a man page detailing both commands.
Using these two utilities, there is no need
to try and edit them using vi.
HTH
~Michael~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2002 07:30 PM
тАО04-14-2002 07:30 PM
Re: how to search and replace ^M in vi?
:%s/^M//g
note that the ^M is formed by pressing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2002 09:40 PM
тАО04-14-2002 09:40 PM
Re: how to search and replace ^M in vi?
Without using vi, you can also do:
# cat dosfile | col -b > unixfile
OR:
# strings dosfile > unixfile
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2002 10:36 PM
тАО04-14-2002 10:36 PM
Re: how to search and replace ^M in vi?
Switch to Ascii mode (type 'asc' at the ftp prompt) before sending text files, and you won't have this problem.
Hope this helps.
