Sponsored Content
Full Discussion: AWK help reqd
Top Forums Shell Programming and Scripting AWK help reqd Post 302207040 by Sathy153 on Thursday 19th of June 2008 03:24:03 AM
Old 06-19-2008
AWK help ...some additional comparison..

Hi,

If I want to add one more condition to the below while comparing.. can I modify as below =>

Old code
========
awk '
NR==FNR{a[substr($0,1,11)];next} # Create an array of the key (position 1-11) in file2
substr($0,21,11) in a{print} # If position 21-31 of file1 exist in array print the record
' file2 file1

New code
========
awk '
NR==FNR{a[substr($0,1,11)];next} # Create an array of the key (position 1-11) in file2
substr($0,21,11) | substr($0,41,11)in a{print} # If position (21-31) or (41 -51) of file1 exist in array print the record
' file2 file1


Many thanks in advance.
 

10 More Discussions You Might Find Interesting

1. HP-UX

Help Reqd

Hi I am facing the problem where my HP Unix system date is in accordance with the current date but the logs written by the same is of previous time stamp. Eg. System Date - Thu Mar 15 18:00:04 IST 2007 Syslogs - Mar 15 12:30:10 mac@1 ftpd: FTP LOGIN FROM xx.xxx.xxx.xx , main The ftp... (1 Reply)
Discussion started by: PradeepRed
1 Replies

2. HP-UX

command reference sheet reqd.

hi everybody, i m AIX guy.... due 2 some reason i was also askd 2 work in HP-UX so i think all d concepts r same as AIX.... so i thought it s easy to learn by comparitve study.... if so then wr can i get the materials???????? thanks in advance........ (1 Reply)
Discussion started by: rrlog
1 Replies

3. Shell Programming and Scripting

Checklist for Shell Script reqd

Hi, Can anyone provide me with the Code Review Checklist for Shell scripts ?? Thanks in advance. (2 Replies)
Discussion started by: Shivdatta
2 Replies

4. Shell Programming and Scripting

unix shell script reqd...

Task: Short Description: To find the files in a particular directory for the previous day, sort them by date and time and e-mail it across to a particular id. And the time is divided into eight fields and based on the time the respective field should be updated with the flag 1. Eight... (7 Replies)
Discussion started by: venkatesht
7 Replies

5. Shell Programming and Scripting

shell script reqd - deleting files

I have written a script that deletes files: Requirement: i need to delete the files and to know how many files are deleted i.e the count of files and even i need to display when the started time of deletion and the ending time of deletion. I need to display these two times. script: ... (2 Replies)
Discussion started by: venkatesht
2 Replies

6. Shell Programming and Scripting

Shell Script - help Reqd

Hi, I need someone's help in writing a shell script. Since am very new i am stuck . I have 2 files in the same dir. ============================================== FileA Table1~07/07/2009 00:00:00~4 Table1~07/06/2009 00:00:00~41 Table1~07/08/2009 00:00:00~4 ... (8 Replies)
Discussion started by: vijayarajvp
8 Replies

7. Shell Programming and Scripting

Explanation reqd

Hi, i have a script of following content #!/usr/bin/sh 'exit 255' USR1 ncm_CheckDir.pl -a /cnt/mgr/test/working/applog_CheckDir.log -c /cnt/mgr/test/lib/config/bp_CheckDir.conf -s /cnt/mgr/test/log/syslog filename : BC_CheckDir when i execute ie : sh BC_CheckDir i am getting... (11 Replies)
Discussion started by: psthariharan
11 Replies

8. Shell Programming and Scripting

Help reqd in shell scripting..

Hi guys, I am new to shell scripting and I need urgent assistance. I have an xml like : <AgreementNumberFull>13-WY-84252</AgreementNumberFull> <AgreementNumberAbbr>WY84252</AgreementNumberAbbr> <LineOfBusiness>F</LineOfBusiness> <CompanyCode>0005</CompanyCode> <UniqDigit/> <StateCode/> ... (9 Replies)
Discussion started by: puneetkanchi
9 Replies

9. Shell Programming and Scripting

Explanation reqd for the Unix file

Hi, I have a unix file with the following contents #/usr/bin/sh cd /ct/mr/prod/bin ncm_AdjCob.pl -a /ct/mr/prod/wg/applog_AdjDev.log -c /ct/mr/prod/lib/config/bcmp_AdjDevCob.conf -s /ct/mr/prod/log/syslog can anyone explain what it says. particularly -a ,-c... (5 Replies)
Discussion started by: psthariharan
5 Replies

10. UNIX for Dummies Questions & Answers

unable to grep the reqd field

hi all, i have a data sm thg like this 28504 0 abc 148782859 42 101M nhmmmm ilopo abc 2345432 i want to get only the field which is just aftr abc i,e., 148782859, 2345432 i have used grep /abc\t/ filename to get that but its not working can any 1 help me out (5 Replies)
Discussion started by: anurupa777
5 Replies
smime_keys(1)							   User Manuals 						     smime_keys(1)

NAME
smime_keys - Utility to add S/MIME certificate to the internal database used by mutt SYNOPSIS
smime_keys <operation> [file(s) | keyID [file(s)]] DESCRIPTION
The purpose of this tool is to manipulate the internal database of S/MIME certificates used by mutt to sign mail messages which will be sent or to verify mail messages received and signed with S/MIME OPTIONS
init no files needed, inits directory structure. list lists the certificates stored in database. label keyID required. changes/removes/adds label. remove keyID required. verify 1=keyID and optionally 2=CRL Verifies the certificate chain, and optionally wether this certificate is included in supplied CRL (PEM format). Note: to verify all certificates at the same time, replace keyID with "all" add_cert certificate required. add_chain three files reqd: 1=Key, 2=certificate plus 3=intermediate certificate(s). add_p12 one file reqd. Adds keypair to database. file is PKCS12 (e.g. export from netscape). add_pem one file reqd. Adds keypair to database. (file was converted from e.g. PKCS12). add_root one file reqd. Adds PEM root certificate to the location specified within muttrc (smime_verify_* command) NO WARRANTIES
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Mutt Home Page: http://www.mutt.org/ Unix May 2009 smime_keys(1)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy