- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem with vi command
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
05-23-2008 12:02 AM
05-23-2008 12:02 AM
problem with vi command
I need to do a mv file pippo.txt
in a file pipponew.txt , but the file pipponew.txt
must not have more than 120 characters for line.
Someone knows how can I do?
Thank you very much
Felix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2008 03:48 AM
05-23-2008 03:48 AM
Re: problem with vi command
You can use fold(1) to break it at 120:
fold -120 pippo.txt > pipponew.txt
If you want to truncate, you can use awk(1) with a printf to limit the line length.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2008 04:01 AM
05-23-2008 04:01 AM
Re: problem with vi command
As Dennis, noted, 'swk' is an easy way to truncate your lines if that is your choice. It's as simple as:
# awk '{print substr($0,1,10)}' pipponew.txt
...which prints 10-characters beginning from the first (1) character of every line ($0).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2008 05:53 AM
05-23-2008 05:53 AM
Re: problem with vi command
Thank you very much,
with your suggestion , I solved the problem.
Thank you once again
Felix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2008 06:03 PM
05-23-2008 06:03 PM
Re: problem with vi command
If you are happy with your answers, you should reopen the thread and assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#41
http://forums.itrc.hp.com/service/forums/helptips.do?#33