Re: script help



Dave,

This should work:

(A little sloppy, but it does the job...)

#!/bin/sh
#
NUM=`head -1 file1 | awk '{print $1}'`
sed -e 's/\\//g' file1 > file2
cat file2 | while read line
do
CURRENT=`echo $line | awk '{print $1}'`
if [ $CURRENT -eq $NUM ];then
echo "$line \c" >> file3
else
echo "\n$line \c" >> file3
fi
NUM=`echo $CURRENT`
done



Dave Zarnoch
Nationwide Provident
zarnocd@xxxxxxxxxxxxxxxxxxxxxxx




"Miller, Dave
(I.S.)" To: aix-l@xxxxxxxxxxxxx
<Dave.Miller@BHS. cc:
ORG> Subject: script help
Sent by: IBM AIX
Discussion List
<aix-l@Princeton.
EDU>


05/19/2006 11:33
AM
Please respond to
IBM AIX
Discussion List






I'm trying to produce a list of ESS volumes info by combining two files
then sorting them, then joining, but I need help on the latter as the
number of lines varies that needs to be joined.

I can produce a file a la:
1010 4.5 10 vs3 \
1010 XASATEST
1011 4.5 10 vs3 \
1011 XASATEST
1012 4.5 10 vs3 \
1012 XASBTEST-FCS1
1012 XASBTEST-FCS2
1012 XASBTEST-FCS3
1013 4.5 10 vs3 \
1013 XASBTEST-FCS1
1013 XASBTEST-FCS2


AND would like to join the lines and end up with
1010 4.5 10 vs3 1010 XASATEST
1011 4.5 10 vs3 1011 XASATEST
1012 4.5 10 vs3 1012 XASBTEST-FCS1 1012 XASBTEST-FCS2 1012
XASBTEST-FCS3
1013 4.5 10 vs3 1013 XASBTEST-FCS1 1013 XASBTEST-FCS2



But I am stumped as the number of lines to be joined varies?.any help would
be appreciated. Thanks.














CONFIDENTIALITY NOTICE: This email communication and any
attachments may contain confidential and privileged information for
the use of the designated recipients named above. If you are not
the intended recipient, you are hereby notified that you have
received this communication in error and that any review,
disclosure, dissemination, distribution or copying of it or its
contents is prohibited. If you have received this communication in
error, please reply to the sender immediately or by telephone at
(413) 794-0000 and destroy all copies of this communication and any
attachments. For further information regarding Baystate Health's
privacy policy, please visit our Internet web site at
http://www.baystatehealth.com.



Relevant Pages

  • Re: [Full-disclosure] virus in email RTF message MS OE almost disabled
    ... immediately disconnected (for a few interested people I can forward email to taste this thing after receiving appropriate paperwork) ... CONFIDENTIALITY NOTICE: This email communication and any attachments may contain confidential ...
    (Full-Disclosure)
  • Re: Sp2 nodes outside of a frame
    ... power will be the problem ... attachments may contain confidential and privileged information for the ... communication in error and that any review, disclosure, dissemination, ... this communication and any attachments. ...
    (AIX-L)
  • Re: [Full-disclosure] virus in email RTF message MS OE almost disabled
    ... virus in email RTF message MS OE almost disabled ... This email communication and any attachments may contain confidential ... and privileged information for the use of the designated recipients named above. ...
    (Full-Disclosure)
  • Re: [Full-disclosure] virus in email RTF message MS OE almost disabled
    ... CONFIDENTIALITY NOTICE: This email communication and any attachments may contain confidential ... and privileged information for the use of the designated recipients named above. ...
    (Full-Disclosure)
  • Re: Question on unmirroring rootvg before mksysb
    ... CONFIDENTIALITY NOTICE: This email communication and any attachments may ... contain confidential and privileged information for the use of the ... 794-0000 and destroy all copies of this communication and any attachments. ...
    (AIX-L)