Help me with script!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help me with script!
# 1  
Old 08-10-2011
Bug create obsolete script

I have the following below. I have a script that checks the second column
with the third, if the third is higher it is to gather all the patches and
out puts the results. What I want is to still check both the columns but
also not output anything that is obsolete in column four.
Here is the script I have:
Code:
  awk '!/CURRENT/ { if ( length($3) > 1 " " ) {
     if ( $3 > $2 ) {
     print $1" "$2" " $3
    }
  }
  }' acrcxznxx008d-02.patch.report

Code:
  116837    02        04    Sun LDAP C SDK 5.19 patch : SunOS sparc
  117024    04        03    ktsearch 1.3 ktsearch 1.3_x86: KT Search Engine
  117465    02     CURRENT  SunOS 5.10: fwtmp Patch
  118217    10        11    PS 6.3.1 PS 6.3.1_x86: Mobile Access
  118367    04     CURRENT  SunOS 5.10: csh Patch
  118560    02     CURRENT  Obsoleted by: 127127-11 SunOS 5.10: usr/bin/telnet
  patch
  118566    01     CURRENT  SunOS 5.10: patch usr/sbin/ping
  118666    30        27    JavaSE 5.0: update 25 patch (equivalent to JDK
  5.0u25)
  118667    30        27    JavaSE 5.0: update 25 patch (equivalent to JDK
  5.0u25), 64bit
  118676    03     CURRENT  SunOS 5.10: patch for Solaris make and sccs
  utilities
  118683    04        06    SunOS 5.10: Patch for profiling libraries and
  assembler
  118705    02     CURRENT  SunOS 5.10: XVR-1000 GFB Graphics Patch
  118717    02     CURRENT  SunOS 5.10: Sun Video Timing Information Patch
  118718    03        06    SunOS 5.10: Generic Framebuffer configuration
  Graphics Patch
  118735    01        02    Obsoleted by: 138239-01 SunOS 5.10: patch
  usr/sbin/rpc.nisd_resolv
  118777    16        17    SunOS 5.10: Sun GigaSwift Ethernet 1.0 driver
  patch
  118815    05        06    Obsoleted by: 127884-01 SunOS 5.10: awk, nawk
  patch
  118824    01        02    Obsoleted by: 138215-01 SunOS 5.10: patch
  usr/bin/sparcv9/sort


Last edited by maurice0822; 08-10-2011 at 01:53 PM.. Reason: was told by admin to change title
# 2  
Old 08-10-2011
Hello,

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
# 3  
Old 08-10-2011
I apologize

Should I resubmit my question with a different subject title?
# 4  
Old 08-10-2011
Try:
Code:
  awk '!/CURRENT/ && !($4 ~ /Obsoleted/) { if ( length($3) > 1 " " ) {
     if ( $3 > $2 ) {
     print $1" "$2" " $3
    }
  }
  }' acrcxznxx008d-02.patch.report

This User Gave Thanks to yazu For This Post:
# 5  
Old 08-10-2011
Yazu:
thanks so much. It work like a charm.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

5. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies
Login or Register to Ask a Question