Sponsored Content
Full Discussion: fgrep fails...!?
Top Forums Shell Programming and Scripting fgrep fails...!? Post 302128432 by r_sethu on Tuesday 24th of July 2007 08:40:41 PM
Old 07-24-2007
Java fgrep fails...!?

Hi all,

I need to transport a number of files from one server to other. I like to ensure the integrity using file checksum values.
The action plan is,
1. create the list of checksum values for all the files using cksum command in source server.
2. Transfer all the files including the file genered in step 1 to destination server.
3. Take the checksum of each file and compared with the file generated in step 1 using fgrep command.

I have a bash shell script to verify this.
The issue for me, in step 3 when i compared, the fgrep didn't find out even the checksum values changes.
My script is as below:

clear
cksum *.* > tmp.txt
while read N
do
fgrep -c $'(echo $N)' tmp.txt
done<x.txt


Remarks: tmp.txt - the file which generated in the destination server after copied. x.txt - the file which generated in source server (step 1) and transfered along with the files.

Please help me in this regard. Also let me know, any other ideas.

regards,
Sethu.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I need help with fgrep or grep

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

Assigning the return of an fgrep???

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

fgrep

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

FGREP question

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

fgrep to file plus some

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

fgrep command

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

Awk Vs Fgrep

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

Pipe and fgrep

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

Emulate fgrep -f in perl

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

Fgrep -v

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
shishi_authenticator_set_cksum(3)				      shishi					 shishi_authenticator_set_cksum(3)

NAME
shishi_authenticator_set_cksum - API function SYNOPSIS
#include <shishi.h> int shishi_authenticator_set_cksum(Shishi * handle, Shishi_asn1 authenticator, int32_t cksumtype, char * cksum, size_t cksumlen); ARGUMENTS
Shishi * handle shishi handle as allocated by shishi_init(). Shishi_asn1 authenticator authenticator as allocated by shishi_authenticator(). int32_t cksumtype input checksum type to store in authenticator. char * cksum input checksum data to store in authenticator. size_t cksumlen size of input checksum data to store in authenticator. DESCRIPTION
Store checksum value in authenticator. A checksum is usually created by calling shishi_checksum() on some application specific data using the key from the ticket that is being used. To save time, you may want to use shishi_authenticator_add_cksum() instead, which calculates the checksum and calls this function in one step. RETURN VALUE
Returns SHISHI_OK iff successful. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_authenticator_set_cksum(3)
All times are GMT -4. The time now is 02:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy