Sponsored Content
Full Discussion: comparing files content
Top Forums Shell Programming and Scripting comparing files content Post 302253067 by Satyak on Friday 31st of October 2008 12:46:12 AM
Old 10-31-2008
Java comparing files content

hi
i have a set of files , i need to compare one file content with other file content,
i am using cmp -s abc.1 def.2 , but it is not giving theproper o/p even if the content is different.Please help



thanks
Satya
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing file content differences

I need to write a script to find out if there are any .c files created/removed from the last time i monitored the files available. i first created a file to contain all the .c files available on the system. (ls *.c > file1) I created another file using the same command. I used the comm file1... (4 Replies)
Discussion started by: RianTan
4 Replies

2. Shell Programming and Scripting

comparing content of 2 variables in script

hello how can i compare the content of two variables using the if or for loops. I have 2 variables which was formed as result of commands pass into them but i want to now compare the 2 contents and echo where their is a match for examples variable1=`cat file2` variable2=`cat file3` if #... (5 Replies)
Discussion started by: sam4now
5 Replies

3. UNIX for Dummies Questions & Answers

comparing the content of two directories

Hello I want to compare the content of two directories recursively to check if the two directories have the same files. How can I do that? (2 Replies)
Discussion started by: xyzt
2 Replies

4. Shell Programming and Scripting

Comparing 2 csv files and matching content

Hello, I have the following problem: There are two csv files csv-file #1: aaa1, aaa2, ... aaan aaa1, bbb2, ... bbbn aaa1, ccc2, ... cccn bbb1, bbb2, ... bbbn ... zzz1, zzz2, ... zzzn csv-file #2: aaa1, matchvalue1 ccc1, matchvalue2 (7 Replies)
Discussion started by: ghl10000
7 Replies

5. Shell Programming and Scripting

Comparing content of two variables

I have very abstract need of "comparing two variables" and take subsequent actions. please refer to image below https://lh3.googleusercontent.com/-frNk5iA3q1c/TjI3lE0sWOI/AAAAAAAAAIE/fxzB1w07gas/script_block.JPG I have a part of script which reads a file and generates variables based on... (4 Replies)
Discussion started by: animesharma
4 Replies

6. Shell Programming and Scripting

Comparing the matches in two files using awk when both files have their own field separators

I've two files with data like below: file1.txt: AAA,Apples,123 BBB,Bananas,124 CCC,Carrot,125 file2.txt: Store1|AAA|123|11 Store2|BBB|124|23 Store3|CCC|125|57 Store4|DDD|126|38 So,the field separator in file1.txt is a comma and in file2.txt,it is | Now,the output should be... (2 Replies)
Discussion started by: asyed
2 Replies

7. Shell Programming and Scripting

comparing 2 files and creating third file with uncommon content

I want to compare 2 files and create third file with uncommon content. e.g. file1 ajay suhas tom nisha vijay mahish file2 ajay suhas tom nisha expected output file content vijay mahish Is it possible in single command ? Thanks, Ajay (6 Replies)
Discussion started by: ajaypatil_am
6 Replies

8. UNIX for Advanced & Expert Users

How to find duplicates contents in a files by comparing other files?

Hi Guys , we have one directory ...in that directory all files will be set on each day.. files must have header ,contents ,footer.. i wants to compare the header,contents,footer ..if its same means display an error message as 'files contents same' (7 Replies)
Discussion started by: Venkatesh1
7 Replies

9. Shell Programming and Scripting

Comparing file ownership/permission and content of files located on two different servers

Hi All, can some one suggest me a tool to compare file ownership/permission and contents of files located at two different unix servers? Thanks, Pranav (1 Reply)
Discussion started by: Pranav Bhasker
1 Replies

10. UNIX for Beginners Questions & Answers

Comparing two files and list the difference with common first line content of both files

I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ? Source File ************* # file: /local/test_1 # owner: own #... (4 Replies)
Discussion started by: sarathy_a35
4 Replies
Mojo::Content(3pm)					User Contributed Perl Documentation					Mojo::Content(3pm)

NAME
Mojo::Content - HTTP 1.1 content base class SYNOPSIS
use Mojo::Base 'Mojo::Content'; DESCRIPTION
Mojo::Content is an abstract base class for HTTP 1.1 content as described in RFC 2616. EVENTS
Mojo::Content can emit the following events. "drain" $content->on(drain => sub { my ($content, $offset) = @_; ... }); Emitted once all data has been written. $content->on(drain => sub { my $content = shift; $content->write_chunk(time); }); "body" $content->on(body => sub { my $content = shift; ... }); Emitted once all headers have been parsed and the body starts. $content->on(body => sub { my $content = shift; $content->auto_upgrade(0) if $content->headers->header('X-No-MultiPart'); }); "read" $content->on(read => sub { my ($content, $chunk) = @_; ... }); Emitted when a new chunk of content arrives. $content->unsubscribe('read'); $content->on(read => sub { my ($content, $chunk) = @_; say "Streaming: $chunk"; }); ATTRIBUTES
Mojo::Content implements the following attributes. "auto_relax" my $relax = $content->auto_relax; $content = $content->auto_relax(1); Try to detect broken web servers and turn on relaxed parsing automatically. "headers" my $headers = $content->headers; $content = $content->headers(Mojo::Headers->new); Content headers, defaults to a Mojo::Headers object. "max_leftover_size" my $size = $content->max_leftover_size; $content = $content->max_leftover_size(1024); Maximum size in bytes of buffer for pipelined HTTP requests, defaults to the value of the "MOJO_MAX_LEFTOVER_SIZE" environment variable or 262144. "relaxed" my $relaxed = $content->relaxed; $content = $content->relaxed(1); Activate relaxed parsing for HTTP 0.9 and responses that are terminated with a connection close. METHODS
Mojo::Content inherits all methods from Mojo::EventEmitter and implements the following new ones. "body_contains" my $success = $content->body_contains('foo bar baz'); Check if content contains a specific string. Meant to be overloaded in a subclass. "body_size" my $size = $content->body_size; Content size in bytes. Meant to be overloaded in a subclass. "boundary" my $boundary = $content->boundary; Extract multipart boundary from "Content-Type" header. "build_body" my $string = $content->build_body; Render whole body. "build_headers" my $string = $content->build_headers; Render all headers. "charset" my $charset = $content->charset; Extract charset from "Content-Type" header. "clone" my $clone = $content->clone; Clone content if possible, otherwise return "undef". "generate_body_chunk" my $chunk = $content->generate_body_chunk(0); Generate dynamic content. "get_body_chunk" my $chunk = $content->get_body_chunk(0); Get a chunk of content starting from a specfic position. Meant to be overloaded in a subclass. "get_header_chunk" my $chunk = $content->get_header_chunk(13); Get a chunk of the headers starting from a specfic position. "has_leftovers" my $success = $content->has_leftovers; Check if there are leftovers. "header_size" my $size = $content->header_size; Size of headers in bytes. "is_chunked" my $success = $content->is_chunked; Check if content is chunked. "is_dynamic" my $success = $content->is_dynamic; Check if content will be dynamically generated, which prevents "clone" from working. "is_finished" my $success = $content->is_finished; Check if parser is finished. "is_multipart" my $false = $content->is_multipart; False. "is_parsing_body" my $success = $content->is_parsing_body; Check if body parsing started yet. "leftovers" my $bytes = $content->leftovers; Get leftover data from content parser. "parse" $content = $content->parse("Content-Length: 12 Hello World!"); Parse content chunk. "parse_body" $content = $content->parse_body("Hi!"); Parse body chunk. "parse_body_once" $content = $content->parse_body_once("Hi!"); Parse body chunk once. "parse_until_body" $content = $content->parse_until_body("Content-Length: 12 Hello World!"); Parse chunk and stop after headers. "progress" my $size = $content->progress; Size of content already received from message in bytes. "write" $content->write('Hello!'); $content->write('Hello!', sub {...}); Write dynamic content non-blocking, the optional drain callback will be invoked once all data has been written. "write_chunk" $content->write_chunk('Hello!'); $content->write_chunk('Hello!', sub {...}); Write dynamic content non-blocking with "chunked" transfer encoding, the optional drain callback will be invoked once all data has been written. SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::Content(3pm)
All times are GMT -4. The time now is 05:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy