- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vi editor ^M char ... pt 2.. My wired run in ..
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
01-25-2002 07:44 AM
01-25-2002 07:44 AM
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf6f45e938a10d6118ff40090279cd0f9,00.html
But my issue that I have run in to was with my appache.conf file. Now I know this has never been edited in windows. Or anything but When I vi the file I get the ^M at the end of everything.But when I more the file it looks good. .. weird. Well I never messed with it and it never messed anything up. So I just left it alone. But I have always wondered why it would show on the vi but not on the more. Doesnt show with cat either. Only vi.
richard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:49 AM
01-25-2002 07:49 AM
SolutionThe vi makes a non printable character visible and what you have is an extra carriage return because the file is in dos format and cr is implicit in UX.
More will ignore it as will cat
To remove
A)dos2ux
B)Problem Description
I have transferred a file from another system, and I am editing the file
with the vi editor. The file has embedded carriage returns, which the
editor is displaying as ^M. How can I remove these extra characters?
Configuration Info
System 9000 HP-UX
Solution
Use the tr(1) command to remove these characters from the file.
First, quit the vi editor and then do the following:
Execute the tr command:
1. tr -d \\015 < inp_file > new_file
2. Inspect the file new_file with vi to check that the ^M's are gone.
C)vi file
use
:1,$s/cntrlvcntrlm//g
where cntrlv = control+v
cntrlm = control+m
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:52 AM
01-25-2002 07:52 AM
Re: vi editor ^M char ... pt 2.. My wired run in ..
If you are already in vi when you notice these "extra"'s, you can remove them by doing this:
:s/^v^m//g999999
Where ^v is control v, and ^m is control m.
or as already stated outside of vi: dos2unix
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:53 AM
01-25-2002 07:53 AM
Re: vi editor ^M char ... pt 2.. My wired run in ..
"cat" command suppresses the control characters and uses the terminal settings to interpret the control characters. If you want to view the control charcater use the -v option with cat command. Without -v option the terminal will display the control character with cat if the terminal is set to display control charcacters instead of interpreting them.
cat -v file_name
hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:55 AM
01-25-2002 07:55 AM
Re: vi editor ^M char ... pt 2.. My wired run in ..
^M is a control char
This is vi interpretes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:55 AM
01-25-2002 07:55 AM
Re: vi editor ^M char ... pt 2.. My wired run in ..
This is a DOS/Windows textfile where the convention the convention is that every line ends with a CRLR Pair. In UNIX textfiles, each line simply ends in an LF.
In CR's are ASCII 13's (decimal) or Ctrl-M's; LF's are ASCII 10's (decimal) or Ctrl-J's.
In most cases, your output device is set yo ignore CR's and that is why you don't see them with cat. There are utilities to remove the CR's. Man dos2ux for details. Man stty for details on why you don't see CR's.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 08:07 AM
01-25-2002 08:07 AM
Re: vi editor ^M char ... pt 2.. My wired run in ..
10s for everyone..
Richard