07-25-2007
I have two questions about your script.
Why do you use *.* instead of * ?
Only files with an extension will be processed.
The output of your fgrep command is presumably 0 or 1 so how will you know which file has failed?
If the txt files are in the same sequence why not use 'diff' to find differences.
So:
sort <tmp.txt >tmp.srt
sort <x.txt >x.srt
diff x.srt tmp.srt
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can I do an and condition with fgrep.
I want to do:
ps -ef | fgrep -f searchvalues > tempmail.file
mailx -s "Email Subject" email@domain.com < tempmail.file
The search values file contains:
opt/bea.*java.*80
mysqld
What I want is to find things that contain:
mysqld OR... (7 Replies)
Discussion started by: jimmy
7 Replies
2. Shell Programming and Scripting
Im haveing a problem with a script that i am currently writing. I am new to scripting and dont know it all that well. I cant use perl so please dont post perl scripts.
The problem is when i try and asign the result of the fgrep to qdetail. It does not seem to like that assignment. any ideas... (2 Replies)
Discussion started by: intergltc
2 Replies
3. UNIX for Advanced & Expert Users
Hi Guys,
Can anyone explain why I'm getting error below? when I execute in other server there is no error, what could be the reason.
$ fgrep -f timecell.txt ldap_prev.dat
wordlist too large
$ wc -l timecell.txt ldap_prev.dat
372461 timecell.txt
3722878 ldap_prev.dat
Thanks in... (2 Replies)
Discussion started by: krishna
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I need fgrep to search all files in the subdirectories in /var/spool/postfix/defer/...
How can I issue such a command? (3 Replies)
Discussion started by: mojoman
3 Replies
5. Shell Programming and Scripting
Hi,
I know that I can grep desired data to a file but is there a way to add an additional field of data to the output in addition to what is found. I want to add a login id to the data that is found in the grep. Is this even possible? Thanks for your help.
Toni (14 Replies)
Discussion started by: ski
14 Replies
6. Shell Programming and Scripting
How can we use fgrep command to search pattern on perticular field on a file.
eg : I have a parren file having format
cat patternfile
SPA16S199982
SPA5S26330
I want to seach these pattern on FIRST field of File2(since other field has
same data) and that too maching entirely.
... (10 Replies)
Discussion started by: morbid_angel
10 Replies
7. Shell Programming and Scripting
Hi All,
I have 2 files new.txt and old.txt
cat new.txt
sku1|v1|v2|v3
sku2|v11|v22|v33
sku3|v11|v22|v33
cat old.txt
sku1|vx1|vx2|vx3
sku2|vx11|vx22|vx33
sku3|v11|v22|v33
The key column in both files are first column itself.
I want to get records in... (6 Replies)
Discussion started by: morbid_angel
6 Replies
8. Shell Programming and Scripting
Hi ,
Please help me resolve the below issue.
I need to combine the below two command into one.
grep 'ImanItemP' import.report| tr -s ' ' | cut -f2 -d ' ' > tmp.txt
fgrep -v -f tmp.txt input.txt > reuired file.txt
Thanks
Ramesh (4 Replies)
Discussion started by: ramesh12621
4 Replies
9. Shell Programming and Scripting
Is there any equivalent of the below requirement in perl
fgrep -f file1 file2 > file3 (2 Replies)
Discussion started by: aravindj80
2 Replies
10. UNIX for Dummies Questions & Answers
Using the fgrep command with the -v option.
I have two files:
file1:
dog 1
cat 3
bird 5
fish 7file2:
dog
catUsing fgrep -v file2 file1 According to the fgrep man page, the output should be bird5
fish 7 but I can't seem to get it to work. Any help would be appreciated. (2 Replies)
Discussion started by: jimmyf
2 Replies
LEARN ABOUT NETBSD
in4_cksum
IN_CKSUM(9) BSD Kernel Developer's Manual IN_CKSUM(9)
NAME
in_cksum, in4_cksum, in6_cksum -- compute Internet checksum
SYNOPSIS
uint16_t
in_cksum(struct mbuf *m, int len);
uint16_t
in4_cksum(struct mbuf *m, uint8_t nxt, int off, int len);
uint16_t
in6_cksum(struct mbuf *m, uint8_t nxt, int off, int len);
DESCRIPTION
These functions are used to compute the ones-complement checksum required by IP and IPv6. The in4_cksum() function is used to compute the
transport-layer checksum required by tcp(4) and udp(4) over a range of bytes starting at off and continuing on for len bytes within the mbuf
m.
If the nxt parameter is non-zero, it is assumed to be an IP protocol number. It is also assumed that the data within m starts with an IP
header, and the transport-layer header starts at off; a pseudo-header is constructed as specified in RFC768 and RFC793, and the pseudo-header
is prepended to the data covered by the checksum.
The in6_cksum() function is similar; if nxt is non-zero, it is assumed that m starts with an IPv6 header, and that the transport-layer header
starts after off bytes.
The in_cksum() function is equivalent to in4_cksum(m, 0, 0, len).
These functions are always performance critical and should be reimplemented in assembler or optimized C for each platform; when available,
use of repeated full-width add-with-carry followed by reduction of the sum to a 16 bit width usually leads to best results. See RFC's 1071,
1141, 1624, and 1936 for more information about efficient computation of the internet checksum.
RETURN VALUES
All three functions return the computed checksum value.
SEE ALSO
inet(4), inet6(4), tcp(4), udp(4), protocols(5), mbuf(9)
STANDARDS
These functions implement the Internet transport-layer checksum as specified in RFC768, RFC793, and RFC2460.
BUGS
The in6_cksum() function currently requires special handling of link-local addresses in the pseudo-header due to the use of embedded scope-
id's within link-local addresses.
BSD
May 22, 2001 BSD