Help needed Urgently... Thanks in advance

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Help needed Urgently... Thanks in advance
# 1  
Old 08-19-2009
Help needed Urgently... Thanks in advance

You have a file called /opt/test/input.txt with the following information:

    man_aa_bld_100.410.040_CMD 08/14/2008  23:29:21 08/14/2008  23:31:10 SU 5339491/1
    man_aa_bld_100.410.050_CMD 08/14/2008  23:29:21 08/14/2008  23:31:11 SU 5339491/1
    man_aa_bld_100.410.060_CMD 08/14/2008  23:29:21 08/14/2008  23:31:14 SU 5339491/1
    man_aa_pro_100.425.000_CMD -----                -----                                          AC 5339491/0
    man_aa_pro_100.430.000_CMD -----                -----                                          AC 5339491/0
    man_aa_bld_100.410.070_CMD 08/14/2008  23:29:21 08/14/2008  23:30:23 SU 5339491/1
    man_aa_bld_100.410.080_CMD 08/14/2008  23:29:21 08/14/2008  23:30:27 SU 5339491/1
    man_aa_bld_100.410.090_CMD 08/14/2008  23:29:22 08/14/2008  23:31:05 SU 5339491/1
    man_aa_pro_100.420.000_CMD 08/14/2008  23:31:50 -----                             RU 5339491/1

Write the instruction to create a file called /opt/text/output.txt with the following results:
sendevent -E CHANGE_STATUS -s SUCCESS -P 1 -J man_aa_pro_100.425.000_CMD
  sendevent -E CHANGE_STATUS -s SUCCESS -P 1 -J man_aa_pro_100.425.000_CMD

Please note that from input.txt you have to take the rows with status AC (Lines in blue).

Last edited by vgersh99; 08-19-2009 at 04:05 PM.. Reason: code tags, PLEASE!
# 2  
Old 08-19-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

---------- Post updated at 03:10 PM ---------- Previous update was at 03:05 PM ----------

nawk '$(NF-1)=="AC" {printf("sendevent -E CHANGE_STATUS -s SUCCESS -P 1 -J %s\n", $1)}' /opt/test/input.txt > /opt/text/output.txt

# 3  
Old 08-19-2009
THanks a Bunch Dude...
# 4  
Old 08-19-2009

Per our forum rules, all threads must have a descriptive subject text. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".

The reason for this is that nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, the subject field must be something useful and related to the problem!

In addition, current forum users who are kind enough to answer questions should be able to understand the essence of your query at first glance.

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your subject text. You might receive a forum infraction if you don't pay attention to this.

Thank you.

The UNIX and Linux Forums
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed urgently. Look back for files in PERL

I have 3 variables $file =abc_2011_11_01.txt (current day file) $back = Yes $forward = No I need to search for 3 days back files / 3 days forward files if my current file is not present logic is, I need to download the current day file. If it is missing, i need to look out for... (1 Reply)
Discussion started by: irudayaraj
1 Replies

2. Shell Programming and Scripting

Advance file parsing...

hi all i have a file of the format Time(starting from 0 in asc order) bytes service flags protocols e.g. 0, 0, 0, 56, 56 1, 524, 3, 6, 75 1, 624, 0, 43, 53 2, 72, 0, 43, 80 3, ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

3. UNIX for Advanced & Expert Users

Please correct my script - Needed very urgently

hello all, I have a script, used to search for the strings from the set of 5 similar pattern file from the log dir. So here it goes . The input parameter is a part of the file name. When during the script execution, the script should parse the input parameter to original file's with the same... (1 Reply)
Discussion started by: raghunsi
1 Replies

4. Solaris

Advance 2 Days

Hi, Anyone can help me, how to used the advance 2 days? today is : 20090915 i need to get the date : 20090917 in the OS level Thanks, DBM (4 Replies)
Discussion started by: dba_macau
4 Replies

5. UNIX for Advanced & Expert Users

Regarding Advance installation

Hi to all, I have one doubt in unix/linux installation. There are two systems in which one is Sparc system having no CD-Rom, No O/S and fresh Hard disk and another system is having windows O/S. Now, can i install unix or linux o/s in the Empty Sparc System by using other system which is... (1 Reply)
Discussion started by: sasidarvarma
1 Replies

6. UNIX for Dummies Questions & Answers

Help NEEDED urgently on exceutable file

Hi , i amtrying to execute a file called bcs_maint which is the final executable for our project. Normally on some other servers ican execute it by just typing bcs_maint. yesterday i got a new worksattion for me and when i do the same it says /sbin/sh: bcs_maint : not found. What... (5 Replies)
Discussion started by: jagan_kalluri
5 Replies

7. Shell Programming and Scripting

help needed urgently

hi all i need help I am confused and stucked. Actually i am new in this scripting stuff. I want to give complete txt file as a input to a variable and then sort the data in the file according to the alpha numeric characters, as my text file contains ! and !! and !!! indicating Minor, Major and... (11 Replies)
Discussion started by: nabmufti
11 Replies

8. Shell Programming and Scripting

A more advance Alias

Hey all, I want to go ahead and create a alias for the command /bin/passwd. But I want to do this so that it will/can detect if the -r option is added to the command as well...Can this be done... For example if the user enters: # passwd --> Alias will issue /bin/passwd -r # passwd -r... (0 Replies)
Discussion started by: msbutton27
0 Replies

9. UNIX for Dummies Questions & Answers

Major Help Urgently Needed!!!!

Right deleted Linux partition usig windows then went to format c:\ but had to exit window now pc ONLY boots into GNU Grub. Does anyone know how to format the hard drive now????? (3 Replies)
Discussion started by: billett05
3 Replies

10. Shell Programming and Scripting

Shell Script needed urgently

Hi Frends, I am need of a small shell script. Kindly any body help me by giving me a small shell script to read first line in a file and extract date from the first line and store it in a variable... and after storing it in a variable the first and the last line of the file has to be deleted..... (2 Replies)
Discussion started by: vas_dba
2 Replies
Login or Register to Ask a Question