- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: vi questions
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
10-29-2001 10:20 AM
10-29-2001 10:20 AM
Second question, a couple of the developers are saying their ctrl-M represents linefeed instead of carriage return. Have looked in their .profile and .exrc. Is there another place I should be looking? Thankyou in advance for you assistance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:30 AM
10-29-2001 10:30 AM
Re: vi questions
Not sure how to make vi show newlines? However, the dev are somewhat correct about the ^M. The ^M is a linefeed charater. This comes about most of the time when transfering ascii files from a windows system to a unix system. Windows systems use linefeed vs newline used by unix systems. You can correct this buy running dos2ux on the files. man dos2ux.
Also tell your dev when ftping ascii file to always transfer them as ascii. ftp will automatically do the translation for you.
Hope this helps.
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:38 AM
10-29-2001 10:38 AM
Re: vi questions
#cat -vet
will produce the same results (read-only)
2) ^M is in fact the carriadge return, not line feed. Look in "UNIX in a Nutshell" by O'Reilly.
Hope this helps
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:38 AM
10-29-2001 10:38 AM
Re: vi questions
:set list
will display "control characters"
To remove extra "control M's" do this, from vi, although there are other external ways:
:s/
It will display :s/^M//g99999
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:51 AM
10-29-2001 10:51 AM
Re: vi questions
Take a look at the thread below for more info.
http://us-support.external.hp.com/cki/bin/doc.pl/sid=53d7ca29066fa59bdb/screen=ckiDisplayDocument?docId=200000007951364
http://us-support.external.hp.com/cki/bin/doc.pl/sid=53d7ca29066fa59bdb/screen=ckiDisplayDocument?docId=200000010042212
http://us-support.external.hp.com/cki/bin/doc.pl/sid=53d7ca29066fa59bdb/screen=ckiDisplayDocument?docId=200000006454190
Hope this helps.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 11:00 AM
10-29-2001 11:00 AM
Re: vi questions
Developers are wrong. ^M is a carriage return. ^J is a line feed or in UNIX a newline. Verify this with man ascii.
When UNIX sees ^J it is interpreted as advance one line and return cursor to the leftmost column. DOS only interprets ^J as advance one line (as if you manually turned the platen on a typewriter). DOS needs an ^M to move the cursor to the leftmost column.
So one should always ftp ascii files in ascii mode because a function of ftp is the translation of ^J^M for DOS to just ^J for UNIX. dos2ux does the same thing to a file if it was transferred in binary mode.
If you just cat the file, extra ^M characters are not seen. It's just as if you are moving the cursor to the leftmost position and doing it again. vi or od will show the extra characters.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 11:19 AM
10-29-2001 11:19 AM
Re: vi questions
Have a look at 'man 5 ascii'. Not only are the displayed graphics shown, but the keyboard sequences for generating them are given.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 01:37 PM
10-29-2001 01:37 PM
Re: vi questions
1. transfering files using ftp between a PC and Unix but using BINARY rather than ASCII transfers for true ASCII files.
2. Users are sharing PC files using CIFS/9000 (or SAMBA) and the native file formats will not be translated in a disk share.
Here's the issue: DOS/Windows defines plain ASCII file lines as
In DOS/Windows, a true Unix file will look messed up in Notepad (a true ASCII editor) since at the end of each line is a black square (the Unix
In Unix, a DOS/Windows file will have an extra character at the end of each line (the
HP-UX command writers realized a long time ago that this would be a problem and created the two translation programs: dos2ux and ux2dos. They elimnate the need for sed/awk/tr scripts to filter these files in either direction. Check the man pages.
And ftp designers were quite smart in defining a format-neutral way of transmitting ASCII files that would let the recipient prepend/append whatever codes are necessary to form a valid ASCII file on the target system--just use ASCII as the translation method. BINARY transfers turn off all translation.
Note that Wordpad and Word4Windows will seem to accept un-translated Unix files correctly, and indeed, you can cut and paste from WordPad or Word into Notepad and get the right results. However, both WordPad and Word define a single
Bill Hassell, sysadmin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2001 12:41 AM
10-30-2001 12:41 AM
Re: vi questions
vi shows special characters eg
lf is $
cr is ^M
as described in man ascii
Cheers, Thomas:)
PS: you may also want to have a look at man xd