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
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-13-2003 08:14 AM
тАО04-13-2003 08:14 AM
122^M
How can I do if I want to a new file whitout ^M
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 08:39 AM
тАО04-13-2003 08:39 AM
Re: Script
You would typically use sed to do a job like this:
# cat file|sed -e 's/\^M$//' > newfile
This will go through each line in the file taking the ^M from the end.
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 09:15 AM
тАО04-13-2003 09:15 AM
Re: Script
--- global search/replace EOL
so,
# vi filename
Hit
:%s/
Hit
Check to see that the control chars are gone, and save the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 09:22 AM
тАО04-13-2003 09:22 AM
Re: Script
Hold down
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 09:27 AM
тАО04-13-2003 09:27 AM
Re: Script
$ dos2ux oldfile > newfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 01:08 PM
тАО04-13-2003 01:08 PM
Re: Script
I suspect that you transfered your file from a Windows environment using binary transfer mode. If that's the case, in the future, whenever you have a text file toggle an ASCI transfer mode. Doing so automatically invokes the translation of linefeed/carriage return characters used for Windows end-of-line control to the newline character used for Unix (and vice versa).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2003 02:12 PM
тАО04-13-2003 02:12 PM
Re: Script
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2003 05:07 AM
тАО04-14-2003 05:07 AM
Re: Script
cat file | sed 's/.$//g' > outfile
(it's a control character and thus ^M is actually only 1 character)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2003 07:28 AM
тАО04-14-2003 07:28 AM
Re: Script
If your logfile truly is a logfile
Piping the output through "strings" will clear out ^M as well as other unwanted control characters.
strings log.file > newlog.file
or
cat log.file|strings > newlog.file