Re: Comparing Two File Sizes



Begin <7a6d860a-657b-44b0-ae90-0908c303219c@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Sun, 6 Jan 2008 13:58:48 -0800 (PST), Chris <chris95008@xxxxxxxxx> wrote:
Below is the code I have so far. I'm not sure if the #!/bin/sh is
correct but I did try changing it to #!/usr/bin/perl but got
compilation errors.

Perl and shell are very different. If you want to use perl, write
perl. If you'd rather use shell, well, write that. Note that there are
numberous shells (bourne shell, bash, ash, dash, ksh, zsh, csh, tcsh,
and then a bunch more) and their syntaxes differ to greater or lesser
degree. You can find examples that work on shells used as ``/bin/sh''
on many a system upthread and in the group archives, and there's a
newsgroup devoted to ``shell programming'' as well. For perl, well,
there are a couple of newsgroups devoted to that, too.


I'm trying to compare two files and if there different then to run
some commands.

Your original question was strictly about file size, not contents. What
is it that you really want? If you do care about content, what is the
expected content? Something with a known structure like plain text[1] (and
if so, what structure?) or do you treat all files as unknown binaries?
Is mere inequality sufficient or do the differences themselves matter?
And so on, and so forth. A better problem description would be good.


[1] Yes, plain text is often pretty much unstructured in one sense, but
in another, many tools exist that depend on the minimal structure
it does have.

--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
This message was originally posted on Usenet in plain text.
Any other representation, additions, or changes do not have my
consent and may be a violation of international copyright law.
.



Relevant Pages

  • Re: Unexpected result from grep
    ... I'd worry about whether I should be using the shell at all. ... as big a deal as Perl. ... Most people can puzzle out even a complicated shell script and also ... seem to prefer ksh and it sure seems like a better shell to me. ...
    (comp.unix.tru64)
  • Re: Unexpected result from grep
    ... I'd worry about whether I should be using the shell at all. ... as big a deal as Perl. ... Most people can puzzle out even a complicated shell script and also ... seem to prefer ksh and it sure seems like a better shell to me. ...
    (comp.unix.shell)
  • Re: ActiveState: Cant spawn "cmd.exe"?
    ... >> When testing with ActiveState perl what shell are you running in? ... Normally, perl is built using MinGW in the cmd.exe shell, following the ... ActiveState perl, too) in a bash shell, though I've not personally done ...
    (comp.lang.perl.misc)
  • Shell::Jobs - request for comments
    ... In an effort to make the code developed for the Zoidberg shellmore ... perl shells. ... # Run a shell command in the background ...
    (comp.lang.perl.modules)
  • Re: Unix Tools
    ... >>When I read about Unix tools there seems to be a lot of overlap between ... >>Perl, is there any reason at all to look at awk and sed? ... >like shell which will be good for scripting and interactive use. ...
    (comp.unix.questions)