HELP Required Please!!!!!!!!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HELP Required Please!!!!!!!!!
# 1  
Old 07-30-2008
HELP Required Please!!!!!!!!!

Dear Friends,

I have a script below mentioned, it is running OK on Linux platform but somehow now i have to use SOLARIS 10 for this script, When i run this script i have some error messages also given below.

Can any of you help me with this, i will be very thankful to him.


:::::::::::::::::::::::::::::::::::::SCRIPT:::::::::::::::::::::::::::::::::::::::::

#/usr/sbin/ksh
set -x


awk > help.txt '/HW-FAILURE/' ORS="\n" RS= TRE_alarm.txt

cat help.txt | grep "unit-type % bts nbr %" > temp_TRE.txt
cat help.txt | grep "SBL-type % tre nbr %" > temp_TRE1.txt
cat help.txt | grep "HW-FAILURE" >temp_TRE2.txt

cat temp_TRE.txt | awk -F " " '{printf "%s\n" , $6}' > temp.txt
cat temp_TRE1.txt | awk -F " " '{printf "\n" , $6}' > temp1.txt
cat temp_TRE2.txt | awk -F ":" '{printf "\n" , $8}' > temp2.txt

paste temp.txt temp1.txt temp2.txt > dani.txt

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::





:::::::::::::::::::::::::ERROR MESSAGES:::::::::::::::::::

++ awk -F ' ' '{printf "%s\n" , $6}'
awk: can't open {printf "%s\n" , $6}
++ cat temp_TRE1.txt
++ awk -F ' ' '{printf "\n" , $6}'
awk: can't open {printf "\n" , $6}
++ cat temp_TRE2.txt
++ awk -F : '{printf "\n" , $8}'
awk: syntax error near line 1
awk: bailing out near line 1
++ paste temp.txt temp1.txt temp2.txt

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


Thanks a lot in avdance.

Best Regards.
# 2  
Old 07-30-2008
please use a better title for your questions! something like "script runs on linux but not on solaris".

back to your question, the output of awk on solaris is diffrent to that on linux. so $6 is maybe an empty field on solaris!
# 3  
Old 07-30-2008
script runs on linux but not on solaris

Thanks for the help,

Is the syntax of awk is same for linux and Solaris?

Do you have any idea about these two lines....
awk: syntax error near line 1
awk: bailing out near line 1

Thanks.
# 4  
Old 07-30-2008
read the "man" pages about the syntax of awk.
# 5  
Old 07-30-2008
Quote:
Originally Posted by Danish Shakil
[...]

Is the syntax of awk is same for linux and Solaris?

Do you have any idea about these two lines....
awk: syntax error near line 1
awk: bailing out near line 1
[...]
No, they are different. Use nawk or /usr/xpg4/bin/awk instead of the plain old awk on Solaris.
# 6  
Old 07-30-2008
Thanks a lot

Dear radoulov,

Thank you very much its working!!!! Smilie

I used nawk instead of awk on Solaris. Smilie

Please suggest a little more i have a file containing text given below,
i am intrested in numeric value only that appear after BSS_.
For Example in the first line it is 3, second line it is 22.
How can i get numeric value from this!!!!

Thanks for the help again.

DOMAIN="alcomc2_BSS_3"
DOMAIN="alcomc2_BSS_22"
DOMAIN="alcomc2_BSS_22"
DOMAIN="alcomc2_BSS_9"
DOMAIN="alcomc2_BSS_32"
DOMAIN="alcomc2_BSS_55"
DOMAIN="alcomc2_BSS_3"
DOMAIN="alcomc2_BSS_5"

Best Regards
DOMAIN="alcomc2_BSS_5"
DOMAIN="alcomc2_BSS_44
# 7  
Old 07-30-2008
Something like this?

Code:
 sed 's/.*_\([0-9]*\)"$/\1/' filename

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help required

Hi Everyone, I need a little help in manipulating a file. This is what I need. I need to move each line barring the top 3 lines, to the right by a 8 (or some specified number ) of places. Example BEGIN: Vertices Edges Archs 1443 4042 862 4821 254 1177I want to move the... (3 Replies)
Discussion started by: scigeek
3 Replies

2. Shell Programming and Scripting

Help required

Dear All, I need to script to change TTL of all zone file in my DNS and aslo i require the serial to be updated to reduce my work load. Regards Vicky (0 Replies)
Discussion started by: search4u2003
0 Replies

3. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

4. Linux

Help Required

Hi, please suggest me the possible reasons for application to get hang ???? Thanks and Regards Anand P (1 Reply)
Discussion started by: Anand Prakash
1 Replies

5. UNIX and Linux Applications

Help Required

Hi, please suggest me the possible reasons for application to get hang ???? Thanks and Regards Anand P (0 Replies)
Discussion started by: Anand Prakash
0 Replies

6. Solaris

Help required.

Hi, Iam relatively new to Shell scripting. ............ ......... Cur_log_file=`ls -lrt LOGFILE* | grep 'Jun 30' | tail -1` ............... .................. Iam trying to find some log file name to check their status, using above script line. If the log file is not avaible then rest of... (3 Replies)
Discussion started by: Lokesha
3 Replies

7. UNIX for Dummies Questions & Answers

help required

Hi All, Please help me in the following query need a command to get all the files in the present directory except the next day file format :: abc_<DD>.log $ls -l abc_10.log abc_10.log abc_11.log Now i need the output in abc.list which should contains $more abc.list abc_10.log... (5 Replies)
Discussion started by: thaduka
5 Replies

8. Programming

help required

hi i am new to c programming and found this on the net could someone tell me what it actually does, many thanks in advance cheers #include <fcntl.h> main() { int fd; fd = open("in1", O_RDONLY); printf("%d\n", fd); } and this too please #include <fcntl.h> main() { int... (1 Reply)
Discussion started by: ruffenator
1 Replies

9. UNIX for Dummies Questions & Answers

help required

I am new to unix, and have just taken over maintenance/admin of a unix system. I am trying to restore a full backup of one of the consoles on the system. The tape backup device appears to be recognized as it is an option to restore from. After choosing the tape backup and loading the tape, a... (3 Replies)
Discussion started by: ecoli69
3 Replies
Login or Register to Ask a Question