Sponsored Content
Top Forums Shell Programming and Scripting Unable To access array in awk Post 302880009 by siramitsharma on Tuesday 17th of December 2013 06:38:53 AM
Old 12-17-2013
Unable To access array in awk

Hi,
i have the following code in which i am passing array tldn in awk using -v option & despite of that condition is not getting matched,can somebody suggest how to handle shell arrays in awk


Code:
tcount=(9875 9667)

awk -F"\t" -v ltldn="${tldn[*]}" 'NR==FNR {POSTPAIDMDNS[$1]=$2"|"$3;next}
                function ceil(val) { return (val == int(val)) ? val : int(val)+1}
                {
                        (substr($6,length($6)-9,10) in POSTPAIDMDNS && $7 !~ "[A-Z,a-z]" && (substr($20,length($20)-9,4) !~ ltldn))
                                print POSTPAIDMDNS[$6]
                ' FS="\t" PP.txt SS.MRC

IP file is as follows:
Code:
PP.txt:
9875222100      1000000426      15
9875040009      1000001576      1
1415101350      1000000300      1

SS.MRC:

386     130     23:59:31        11/30/2013      0       9875222100      919929377903    45      0       0       0       0       0       0       Ms   null     404001742760058 null    null    9667920916      null    null    IN      00:00:16        null    null    0       null    404009875008997 404009875008997      3501661179
603     130     23:59:49        11/30/2013      0       9875040009      919414288049    41      0       0       0       0       0       0       Ms   null     404001742768413 null    null    9137920523      null    null    IN      00:00:30        null    null    0       null    404009875008997 404009875008997      3501661261

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unable to access hpfs/ntfs properly

i can't access my ntfs partition from one of my linux devices and can only acess it read only on the other... the two linux systems are Fedora core 4 and Ubuntu Hoary hedghog5*... all three are on a 40Gig drive ofcourse the windows partition is the primary partition but Fedora doesn't recognize ... (1 Reply)
Discussion started by: moxxx68
1 Replies

2. Solaris

Unable to access home area

Good morning, I have a solaris 8 machine (Sunblade 1000) that is configured with NIS, I have checked everything I can think of to make sure everything is correctly configured which it appears it is but when I try to log into CDE it says it is unable to access my home area and it also does the... (1 Reply)
Discussion started by: Mr Pink
1 Replies

3. UNIX for Dummies Questions & Answers

Access value outside awk or split value of array

Hello I am new to Unix. Please help me out. My Scenario: I am first collecting all the file names present in the directory with structure myinfo/yourinfo/supplierinfo I have four files with the names myCollector.java, yourCollector.java, someCollector.java, everyCollector.java. in the directory.... (1 Reply)
Discussion started by: jason.bean
1 Replies

4. Shell Programming and Scripting

unable to access a variable not local to a while loop

I have a while loop like this cat ${filename} | while read fileline do ... done I need to access a variable value $newfile inside this while loop How will i do that?? (6 Replies)
Discussion started by: codeman007
6 Replies

5. Solaris

Unable to access 3500 FC array. Where is the problem?..

Hi, I have two Sun Fire V490 with Solaris 10 5/08, FC switch and two Sun StorageTek 3500 FC arrays. Each array is connected to switch and to one server at a time. In the last week I installed Solaris 10 5/08 on both servers and set up Sun Cluster, version 3.2. At wednesday all was fine - all... (7 Replies)
Discussion started by: Sapfeer
7 Replies

6. Shell Programming and Scripting

Unable to access variable outside loop

I am unable to access the value set inside the loop from outside loop . Thought of taking this to forum , I had seen other replies also , where a pipe takes the execution to another shell and mentioned thats the reason we do not get the variable outside loop . But I am getting an issue and I am... (1 Reply)
Discussion started by: Armaan_S
1 Replies

7. Solaris

unable to access infodoc!!

Hi, I am refered to see Infodoc 80854. but I am not able to access from sun.com. Is there any precedure to view these?. Please guide me. Thanks in advance. (1 Reply)
Discussion started by: bpsunadm
1 Replies

8. HP-UX

Unable to access TAR file

hi friends, I am using hp unix HP-UX B.11.11 .. Generally i do the compression to maintain the space availability . To compress the files first i used the TAR to collect all the files. it has done fine. when i am using command ls in the folder which has TAR file , it shows the TAR... (2 Replies)
Discussion started by: rdhaprakasam
2 Replies

9. AIX

P550 Unable to access Console

I have recently aquired the following machine: IBM,9113-550 Up until yesterday we could connect a dumb terminal to serial port 1 and get console login. However the dumb terminal died. We are now using a laptop with a null modem cable attached to serial port 1. This works perfectly for all of... (1 Reply)
Discussion started by: rsw7724
1 Replies

10. AIX

Unable to access to p5 9131 AIX system

Hi, I am very newbie with AIX system. I have changed the default IP address 192.168.2.147 of HMC1 to our LAN IP address. I can ping to the new ip address but unable to access to ASMI again with the new ip address. Is there a way that I can connect to the console or can reset to the default... (20 Replies)
Discussion started by: lilyn
20 Replies
adt-virt-null(1)					     Linux Programmer's Manual						  adt-virt-null(1)

NAME
adt-virt-null - autopkgtest null virtualisation server SYNOPSYS
adt-virt-null [options] DESCRIPTION
adt-virt-null provides a dummy autopkgtest virtualisation server which does not actually offer any kind of separation between host and testbed. Normally adt-virt-null will be invoked by adt-run. There is of course no locking; nothing prevents multiple simultaneous programs from invoking adt-virt-null so as to reuse the same system as a testbed. OPTIONS
-d | --debug Enables debugging output. Probably not hugely interesting. INPUT, OUTPUT AND EXIT STATUS The behaviour of adt-virt-null is as described by the AutomatedTesting virtualisation regime specification. SEE ALSO
adt-run(1), adt-virt-chroot(1), adt-virt-xenlvm(1), /usr/share/doc/autopkgtest/. AUTHORS AND COPYRIGHT
This manpage is part of autopkgtest, a tool for testing Debian binary packages. autopkgtest is Copyright (C) 2006-2007 Canonical Ltd and others. See /usr/share/doc/autopkgtest/CREDITS for the list of contributors and full copying conditions. autopkgtest 2007 adt-virt-null(1)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy