help please


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help please
# 1  
Old 11-19-2008
help please

Hello Im working on a script for work. This is what I got so far:

[#!/bin/ksh]
[# select working directory]
[dir_Name=/u/chry3770]
[cd ${dir_Name}]
[check_status=$(status_3770 chry3770)]
[echo ${check_status}]

this will check some lines for connectivity now my question Smilie

when I put the command in unix i get this output:
Checking status of /u/chry3770 3770 Session services.
B377004e : Script input: * stts
B377003d : (1)-----------------------------------------------------------------
B377003e : (1) Status for PU:VISCHPU - LU:VISCHLU2
B377003f : (1) Session States SSCP-LU: CONTENTION LU-LU: CONTENTION
B3770040 : (1) RUs sent = 0
B3770041 : (1) RUs received = 78105
B3770042 : (1) ANY Output File = chry3770.fil.1
B377003d : (1)-----------------------------------------------------------------
B377003d : (2)-----------------------------------------------------------------
B377003e : (2) Status for PU:VISCHPU - LU:VISCHLU1
B377003f : (2) Session States SSCP-LU: CONTENTION LU-LU: CONTENTION
B3770040 : (2) RUs sent = 0
B3770041 : (2) RUs received = 15888
B3770042 : (2) ANY Output File = chry3770.fil.2
B377003d : (2)-----------------------------------------------------------------

my output when I run the script is the following:

Checking status of /u/chry3770 3770 Session services. B377004e : Script input: badfils bx_7 chry3770.fil.1.1.11 chry3770.fil.1.1.3 chry3770.fil.1.1.7 chry3770.fil.1.1.9 chry3770.log chry3770.log.1 error job_end_script logs start_chry3370.011207 start_chry3770 start_chry3770.011207 start_chry3770.070202 start_chry3770.org start_chry3770bak.061506 ttab_filt unknown work stts B377003d : (1)----------------------------------------------------------------- B377003e : (1) Status for PU:VISCHPU - LU:VISCHLU2 B377003f : (1) Session States SSCP-LU: CONTENTION LU-LU: CONTENTION B3770040 : (1) RUs sent = 0 B3770041 : (1) RUs received = 78105 B3770042 : (1) ANY Output File = chry3770.fil.1 B377003d : (1)----------------------------------------------------------------- B377003d : (2)----------------------------------------------------------------- B377003e : (2) Status for PU:VISCHPU - LU:VISCHLU1 B377003f : (2) Session States SSCP-LU: CONTENTION LU-LU: CONTENTION B3770040 : (2) RUs sent = 0 B3770041 : (2) RUs received = 15888 B3770042 : (2) ANY Output File = chry3770.fil.2 B377003d : (2)-----------------------------------------------------------------

is there anything I can do so that my output is the same with the actual one.

Thanks in advance ill really apreciate an answer.

Last edited by d4n3lu; 11-19-2008 at 01:27 PM..
# 2  
Old 11-19-2008
use double quotes,
Code:
echo "${check_status}"

... edit your original post and use [code] tags for code and sample.
# 3  
Old 11-19-2008
thank you sir that did the trick. I have change the post hope its ok now. This is my first time posting in this forum.
# 4  
Old 11-19-2008
new question

I am trying to send an email to my email when the output looks like this

B377004e : Script input: * stts
B377003d : (1)-----------------------------------------------------------------
B377003e : (1) Status for PU:VISCHPU - LU:VISCHLU2
B377003f : (1) Session States SSCP-LU: INACTION LU-LU: INACTION
B3770040 : (1) RUs sent = 0
B3770041 : (1) RUs received = 1
B3770042 : (1) ANY Output File = chry3770.fil.1
B377003d : (1)-----------------------------------------------------------------
B377003d : (2)-----------------------------------------------------------------
B377003e : (2) Status for PU:VISCHPU - LU:VISCHLU1
B377003f : (2) Session States SSCP-LU: INACTION LU-LU: INACTION
B3770040 : (2) RUs sent = 0
B3770041 : (2) RUs received = 0
B3770042 : (2) ANY Output File = chry3770.fil.2
B377003d : (2)-----------------------------------------------------------------


thanks in advance
# 5  
Old 11-19-2008
Quote:
Originally Posted by d4n3lu
thank you sir that did the trick. I have change the post hope its ok now. This is my first time posting in this forum.
No not like that , thanks for trying Smilie

Edit your post and at the begining of your code/data sample put [code] tag , and at the end of your code/data sample close the [/code+] tag (remove the + sign)
Your code should look like this:
Code:
#!/bin/ksh
# select working directory
dir_Name=/u/chry3770
cd ${dir_Name}
check_status=$(status_3770 chry3770)
echo ${check_status

Click on Reply and you will see the [code] tags.


For your new question start a new thread or search the forum for answers.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question