Results 1 to 6 of 6
A buddy of mine is trying to format the output of "/usr/local/bin/tw_cli /c0/u0 show". Running this from the terminal outputs something like this:
Unit UnitType Status %Cmpl Port Stripe Size(GB) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-29-2007 #1Just Joined!
- Join Date
- Mar 2007
- Posts
- 3
Echo not preserving linebreaks?
A buddy of mine is trying to format the output of "/usr/local/bin/tw_cli /c0/u0 show". Running this from the terminal outputs something like this:
This is what it should look like. Now, we're trying to echo it to an HTML file for easy viewing, using this:Unit UnitType Status %Cmpl Port Stripe Size(GB) Blocks
-----------------------------------------------------------------------
u0 RAID-1 OK - - - 465.761 976771120
u0-0 DISK OK - p0 - 465.761 976771120
u0-1 DISK OK - p1 - 465.761 976771120
When that happens, all the line breaks are removed. Is there any way to preserve them, or somehow add them in?Code:echo -e `/usr/local/bin/tw_cli /c0/u0 show` > /var/www/status.html
- 03-29-2007 #2
Any reason why
will not work for you?Code:/usr/local/bin/tw_cli /c0/u0 show > /var/www/status.html
- 03-29-2007 #3Just Joined!
- Join Date
- Mar 2007
- Posts
- 3
Oh my...always trying to do things the hard way.

Thanks!
One more: Is there any way to add a timestamp? We're trying to do this with a crontab, so far we have:
Bah, "date" is more than enough.Code:00,15,30,45 * * * * /usr/local/bin/tw_cli /c0/u0 show > /var/www/status.html
- 03-29-2007 #4The reason is, the output does not contain escape-sequences and thus 'echo' could not detect it.When that happens, all the line breaks are removed. Is there any way to preserve them, or somehow add them in?---------------------------------
Registered Linux User #440311
HI2ARUN _AT_ GMAIL _DOT_ COM
---------------------------------
- 03-29-2007 #5Add a timestamp to what? The data contained in 'status.html'?
Originally Posted by LoKe
- 03-29-2007 #6Just Joined!
- Join Date
- Mar 2007
- Posts
- 3
Pretty much. Basically he just wanted to know when the check was done. I'm a little confused as to why he wants this, since it's run by a crontab hourly, and the contents are replaced each time. Kind of pointless, I'd think.
Originally Posted by CodeRoot


Reply With Quote
