differentiating two sets for filenames????


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting differentiating two sets for filenames????
# 8  
Old 12-16-2008
am also using bash and it is working fine for me.

pls check whether awk line is broken
# 9  
Old 12-16-2008
Quote:
Originally Posted by manikantants
am also using bash and it is working fine for me.

pls check whether awk line is broken
Its strange
all awk line is single. even then following error

/home/odyssey/f091018>./cmp.awk sett2 sett1
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: bailing out near line 1

are you using any line like #!/bin/bash or something.
don't know why not working for me?????
# 10  
Old 12-16-2008
Quote:
Originally Posted by skyineyes
Its strange
all awk line is single. even then following error

/home/odyssey/f091018>./cmp.awk sett2 sett1
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: bailing out near line 1

are you using any line like #!/bin/bash or something.
don't know why not working for me?????
Using following line in start
#! /usr/bin/nawk -f
first_file=$1
second_file=$2

awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1 in a) { a[$1]=1 } } END { for ( i in a ) { if (a[i]
==0) { print i } } }' $first_file $second_file


Errors are

/home/odyssey/f091018>./cmp.awk sett2 sett1
/usr/bin/nawk: syntax error at source line 5
context is
awk >>> -F@ <<<
/usr/bin/nawk: bailing out at source line 5
# 11  
Old 12-16-2008
first line is not required.

Don't have any clue. Someone else has to bump.
# 12  
Old 12-16-2008
Quote:
Originally Posted by manikantants
first line is not required.

Don't have any clue. Someone else has to bump.
Can you please paste your awk script and sett1 and sett2 contents???
Also the way you are using ????
# 13  
Old 12-16-2008
sett1:

./cwhelper/tcwhelper.cpp@@/main/62

sett2:

./cwhelper/tcwauthlatesettreqcreen.hpp@@/main/1
./cwhelper/tcwhelper.cpp@@/main/64

cmp.awk:

first_file=$1
second_file=$2

awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1 in a) { a[$1]=1 } } END { for ( i in a ) { if (a[i] ==0) { print i } } }' $first_file $second_file

./cmp.awk sett2 sett1

output:

./cwhelper/tcwauthlatesettreqcreen.hpp
# 14  
Old 12-16-2008
Quote:
Originally Posted by manikantants
sett1:

./cwhelper/tcwhelper.cpp@@/main/62

sett2:

./cwhelper/tcwauthlatesettreqcreen.hpp@@/main/1
./cwhelper/tcwhelper.cpp@@/main/64

cmp.awk:

first_file=$1
second_file=$2

awk -F@ '{ if (FNR==NR) { a[$1]=0; next } if ($1 in a) { a[$1]=1 } } END { for ( i in a ) { if (a[i] ==0) { print i } } }' $first_file $second_file

./cmp.awk sett2 sett1

output:

./cwhelper/tcwauthlatesettreqcreen.hpp

Strange !!!!
everything same. whats the error with me ???
In other awk scripts i had used #! /usr/bin/nawk -f and they are working fine. whats the problem with this script????
please help???

Last edited by skyineyes; 12-16-2008 at 09:26 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merging and differentiating 2 files

I have 2 csv files say file1 and file2. Based on 2 columns, I want to check if the values of file1 is present in file 2 or not. If it's not present then it should create a file with the values which are not present. Basically I want the minus between 2 files but based on 2 columns but the output... (2 Replies)
Discussion started by: Gangadhar Reddy
2 Replies

2. UNIX for Advanced & Expert Users

sets the remote server's name

Hi all, does any one have any idea on how to sets the remote server's name on ubuntu terminal tabs, without making any changes to the remote server? for example if i'm working on ssh root@test1 i would like it to be shown on the tittle's tab and if i connect on another it would do the same... (7 Replies)
Discussion started by: charli1
7 Replies

3. Shell Programming and Scripting

differentiating PIDs under 200

Hey, So I'm new to shell scripting, and I'm trying to write one for my lab that will keep down the work load by deleting processes that are left over from previous sessions. Basically I want it to do three things. 1) Check the processes running 2) See if that person is logged on. 3) if... (2 Replies)
Discussion started by: prgoodwin
2 Replies

4. UNIX for Dummies Questions & Answers

Parameters to check while differentiating two servers

Hi All, I have two solaris servers. Please tell me what all parameters i can check to find out the difference between two servers. how to differentiate based on H/W,S/W etc like i have two servers spdwa013 $ uname -an SunOS spdwa013 5.8 Generic_117350-61 sun4u sparc SUNW,Sun-Fire-480R ... (1 Reply)
Discussion started by: usha rao
1 Replies

5. Shell Programming and Scripting

differentiating two sets

Hi Suppose i have a set of files like this set1 a.cpp@@main/5 b.cpp@@main/6 set 2 m.cpp@@main/51 n.hpp@@main/51 a.cpp@@main/15 b.cpp@@main/2 there may be files with same name in 2 sets. i need to list the files in set1 which have last numeric field less than the same file in... (15 Replies)
Discussion started by: skyineyes
15 Replies

6. Programming

How An Application Sets The Ip Options???

Hello Friends, I'm involved in test the UDP/IP source code. As you might be knowing, IPv4 provides several options: like Loose Source and Record Route (LSRR), Strict Source and Record Route (SSRR) etc. I wanted to test the above mentioned IP options. My strategy is to write a test application... (3 Replies)
Discussion started by: aamirglb
3 Replies

7. Virtualization and Cloud Computing

Clouds (Partially Order Sets) - Streams (Linearly Ordered Sets) - Part 2

timbass Sat, 28 Jul 2007 10:07:53 +0000 Originally posted in Yahoo! CEP-Interest Here is my follow-up note on posets (partially ordered sets) and tosets (totally or linearly ordered sets) as background set theory for event processing, and in particular CEP and ESP. In my last note, we... (0 Replies)
Discussion started by: Linux Bot
0 Replies

8. Shell Programming and Scripting

Character Sets

Hi I was just wondering if there was a way in which i could find out the character set used in a file in HP-UX. ie Whether it is Unicode, UTF-8,ascii etc. Regards (3 Replies)
Discussion started by: PradeepRed
3 Replies

9. UNIX for Advanced & Expert Users

FILE SETS in unix

Hi all, Pls. let me know whether there is any concept called "FILE SETS" in unix? Because, I am using ETL tool DataStage which creates FILE SETS. While I am able to view the data of such a file set in the tool, the "cat" command on this FILESET lists only the Metadata and not the data content... (2 Replies)
Discussion started by: Aparna_A
2 Replies
Login or Register to Ask a Question