Operating System - HP-UX
1830624 Members
1960 Online
110015 Solutions
New Discussion

Re: Carriage return missing

 
SOLVED
Go to solution
yc_2
Regular Advisor

Carriage return missing

Hi,

Is there a solution for the missing carriage return in the following script:

#!/usr/bin/sh

CLUSTER_STATUS=`cmviewcl -v` #output of the cluster status

print $CLUSTER_STATUS #Carriage return missing


Thanks in advance,
YC
3 REPLIES 3
Stefan Farrelly
Honored Contributor
Solution

Re: Carriage return missing


print "${CLUSTER_STATUS} \n"

Now it will print with a carriage return.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Peter Kloetgen
Esteemed Contributor

Re: Carriage return missing

Hi,

seems like your command output doesn't give a carriage return to your variable value. Did you try the following:

echo "$CLUSTER_STATUS\n"

this generates a new line into which your cursor is put. Don't forget the quotes, or this will not work. Works also with print command, if you use linux, try

echo -e "$CLUSTER_STATUS"

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
yc_2
Regular Advisor

Re: Carriage return missing

Hi,

Thanks for your answers, but why can't the content be piped and send through mailx as follows:

echo "\n" | mailx -s "Cluster Status" < "$CLUSTER_STATUS\n"


YC