Operating System - HP-UX
1826452 Members
4064 Online
109692 Solutions
New Discussion

suggestion required for the out put of the script

 
SOLVED
Go to solution
Vishal_1980
Regular Advisor

suggestion required for the out put of the script

Hello Experts ,

 

I have a script which tellls about the java & perl version.However when ran the script the output was not proper.

I need to know what shall be done in the script so that the oupt put will be proper,at least a space after every line.

Below is the script & attaching the output of the sctipt.Please suggest.

 

#!/usr/bin/ksh

# sets environment variables

. cv c11jpb

# Displays LAW_JAVA_HOME value, Java version, which Java is being used, Perl version and which Perl is being use

echo $LAW_JAVA_HOME

java -version

which java

perl -version

which perl

 

Thanks & regards,

Vishal

 

 

P.S. This thread has been moved from HP-UX > System Administration to HP-UX > languages. - Hp Forum Moderator

2 REPLIES 2
Patrick Wallek
Honored Contributor
Solution

Re: suggestion required for the out put of the script

If you want a blank line between the output of each command just add an echo between each command.

 

For example:

 

#!/usr/bin/ksh

# sets environment variables

. cv c11jpb

# Displays LAW_JAVA_HOME value, Java version, which Java is being used, Perl version and which Perl is being use

echo $LAW_JAVA_HOME

echo " "

java -version

echo " "

which java

echo " "

perl -version

echo " "

which perl

 

 

************************

 

If you want a bit more information for each command:

 

#!/usr/bin/ksh

# sets environment variables

. cv c11jpb

# Displays LAW_JAVA_HOME value, Java version, which Java is being used, Perl version and which Perl is being use

echo "Command = echo LAW_JAVA_HOME"

echo $LAW_JAVA_HOME

echo " "

echo "Command = java -version"

java -version

echo " "

echo "Command = which java"

which java

echo " "

echo "Command = perl -version"

perl -version

echo " "

echo "Command = which perl"

which perl

Vishal_1980
Regular Advisor

Re: suggestion required for the out put of the script

Thanks a ton Patrick...it really helps me out.

 

With best regards,

Vishal