- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- I redirected command output to a file
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-15-2007 07:14 PM
05-15-2007 07:14 PM
In my HPUX 11.11 system
I redirected command output to a file
But long lines in file splited into two or more lines.
I want the lines whatever length they have must not to be splitted.
I transferred the file to PC and open with MS Word. And I did font very small and page landscape, but lines remain same.
How can I solve this problem?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 07:19 PM
05-15-2007 07:19 PM
Re: I redirected command output to a file
I'm quite sure "Word" is splitting the lines.
"cat" the file on your HP-UX host and you will see the "long lines".
Use another tool on your PC to open the file, e.g. notepad, notepad++ or whatever.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 07:22 PM
05-15-2007 07:22 PM
Re: I redirected command output to a file
Can you vi or cat the output file on the unix box and check ? It would be weird (to say the least) for this to happen on your unix machine.
Cheers,
Wout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 09:18 PM
05-15-2007 09:18 PM
Re: I redirected command output to a file
a few thing you can try:
1. transfer the file using FTP (ASCII mode)
2. Open the file using NOTEPAD
check and let us know
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 10:01 PM
05-15-2007 10:01 PM
Re: I redirected command output to a file
the output of the command
nl myfile
numbers non-empty lines - so you can determinate, if a split occures only on the output of the file.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 10:07 PM
05-15-2007 10:07 PM
Re: I redirected command output to a file
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 10:23 PM
05-15-2007 10:23 PM
Re: I redirected command output to a file
Thanks for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 10:43 PM
05-15-2007 10:43 PM
SolutionWhen you redirect output from a program, the file will have no splits. You can verify this with wc. If real splits take place, the file will have more lines than the original. When you run vi on the file, vi can split lines depending on the setting of wm. You change the wm option (wrap margin) to zero in .exrc or change it with :set wm=0 before you open the file. Then type the command $ which moves to the end of the line. A very long line will see the cursor move down the page to the end of the line. Type 0 (zero) to go back to the beginning. vi can handle and properly display lines more than a thousand characters long.
PCs are very inept at handling text files. Notepad will wrap lines in the window but if you widen the window, you will see the line getting longer. It really is not split. Look at the Notepad options to control word wrap. MS Word is a word processor so by default, Word will split the lines. If you want Word to display (and print) the complete lines then change the page layout to landscape and change the font to 6. That should give you about 250 characters across the page. Oh, you probably will have difficulty reading such a small font. The size of the font you need depends on the maximum length of the line.
Your file was probably not split, only your display window or word processor made it look that way.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2007 02:40 PM
05-16-2007 02:40 PM
Re: I redirected command output to a file
You can also use the following in vi to see line numbers:
:set nu
>numbers non-empty lines
You can use "nl -ba" to number every line.
>Bill: When you redirect output from a program, the file will have no splits.
bdf(1) is a rotten exception and splits lines if the filesystem is "long".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2007 03:58 AM
05-17-2007 03:58 AM
Re: I redirected command output to a file
> bdf(1) is a rotten exception and splits lines if the filesystem is "long".
In this case, the program has decided to split the lines, one of those legacy things from the days of vt100's, Beehives and Lear Siegler ADM3A's with just 80 characters on the screen. Even the 'better' bdf (gdf) splits lines. bdfmegs solves the problem.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2007 07:46 AM
05-17-2007 07:46 AM
Re: I redirected command output to a file
when the main theme is 'splitting of lines', it fits best to get a numbered output ignoring empty lines, IMHO (>Dennis).
Having a possibly large output file, it may be not a good idea to feed vi with it.
To get a statistics of the length of lines, you can use
awk 'BEGIN {print "line\tlength"}
{n=length($0);printf("%d\t%d\n",NR,n);if (n>max) {max=n;li=NR}}
END {printf("longest line(%d) has %d chars\n",li,max)}' outfile
mfG Peter