Internal variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Internal variable
# 1  
Old 09-02-2009
Internal variable

i have a file named (Loop) that contains numbers separated by pipelines
e.g. :
Code:
521|55
545|564
.
.
.

and another file named (search) that contains numbers e.g.:
Code:
99999777|332|332
31215648|458|764

when i run this Script:

Code:
nawk 'BEGIN{FS="|"}
NR==FNR{a[$1"|"$2"|"]= $1"|"$2"|";next}
a[$1"|"$2"|"]{print "found";next}1' Loop search| grep -v found  | grep -v "^[1-2]|"> final

this script is supposed to compare the files (loop) to the file (search), if there's something in (search) that doesn't exist in the (Loop), the output will be redirected to a file named (final), but i can't seem to understand how it works!!!

Last edited by vgersh99; 09-02-2009 at 07:42 AM.. Reason: code tags, PLEASE!
# 2  
Old 09-02-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
# 3  
Old 09-02-2009
thanx for ur feedback, it's my first time using unix forums, i'll make sure to follow the guidlines
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Seeing internal progress of shell

does anyone know if there are any other ways besides "set -x" that can be used to see what a shell script is doing? (1 Reply)
Discussion started by: SkySmart
1 Replies

2. Shell Programming and Scripting

using an awk internal variable as parameter for an external array

Hello, I am running a bash script under linux which first defines an CA-array like j=0 num1=120.00 num2=10.00 until do CA='echo $num1 + $j*$num2' j=$ done within the later awk section of this same script I want to read data from a file. If the value of the second column is... (3 Replies)
Discussion started by: MotAah
3 Replies

3. AIX

Internal error

Dear experts, please inform when i am trying to use dbx to debug my code, iam getting following error: internal error: expected member attribute 's', 'p', 'r' or 'b', found... (1 Reply)
Discussion started by: vin_pll
1 Replies

4. UNIX for Advanced & Expert Users

Forwarding internal internet packets to internal webserver using iptables

Hi, I need to redirect internal internet requests to a auth client site siting on the gateway. Currently users that are authenticated to access the internet have there mac address listed in the FORWARD chain. All other users need to be redirected to a internal site for authentication. Can... (1 Reply)
Discussion started by: mshindo
1 Replies

5. Windows & DOS: Issues & Discussions

regarding internal modems

hi I have two internal modems connected in my system. For these two lines i have connected two separate telephone lines. When i try to call from one modem through the telephone line i get connect message. when i try to call from the other telephone line connected to another modem i did not... (3 Replies)
Discussion started by: rajas1982
3 Replies

6. UNIX for Dummies Questions & Answers

hdisk0 internal

goodpeople, have a corrupt boot volume and systems keep's on crashing with it. suspecting drive is bad. question is how does one determine which of the 5 internal drives I have in my cage is hdisk0 any help would be appreciated Thnx (2 Replies)
Discussion started by: Student37
2 Replies

7. Programming

Unix Internal

What is Unix Internals on a Layman's Language.Can I consider Unix Internal expert for a Unix's Position? Thanks (3 Replies)
Discussion started by: Rengi
3 Replies

8. UNIX for Advanced & Expert Users

internal security

We have about 300 users in the systeme , they mainly use the software called "netterm" to telnet our RH server to access the db in our internal network , I know there are some secure program like ssh , that is more secure for connection , do you think it is good idea to replace the software in our... (2 Replies)
Discussion started by: ust
2 Replies

9. UNIX for Dummies Questions & Answers

how internal modem on pc

Would anyone know how to mount an internal modem on Solaris on PC? (7 Replies)
Discussion started by: softarch
7 Replies
Login or Register to Ask a Question