Counting the number of lines isn't much of a check that the files are really the same - use an actual checksum (e.g. cksum or md5sum).
Something like:
should exit with 0 if the checksums are identical.
(<(stuff) is bash process substitution, but you could use temporary files instead. Feeding cksum from stdin rather than a file means you don't need to care what the filename is.)
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be... (1 Reply)
Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas?
My command looks like:
`ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER `
This check should be... (4 Replies)
Hi Everyone!
This is what I need to do...
I am deploying some directories over to a windows server 2000/3 box from my solaris10 box and I need to make sure the directories exist.
The only form of connection I have to work with is SSH
Currently, my script deploys the directories over... (13 Replies)
Hello, I would appreciate if any one can help me on this.
The below script start running at 12:30AM. Every 5 min, i go and check the remote site. If i see filewatch.txt over there, then i need to call another shell script and load the data into database. If i don't see that file, then i have to... (2 Replies)
Hi,
I need to copy few files from remote server to local server.
I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed.
... (5 Replies)
There is a process which copy files form unix a to unix b
I would like to check whether all files copied from a to b or not ,and list which are the missing files.
Is there a command to check like that (3 Replies)
Hi there,
I have a problem in my script,
I need to check whether file exists in remote server or not,
if the file exists, then stop copy
else copy the file to the server..
my code is something like this
while read $server
do
if ssh $server "cd $directory_name; if ; then echo "Error:... (2 Replies)
Hi All
I need to transfer a file from a UNIX server to a windows server.
I saw that it is possible to do this using scp command by looking at the forum listed below:
... (2 Replies)
Discussion started by: vx04
2 Replies
LEARN ABOUT OSX
shasum5.12
SHASUM(1) Perl Programmers Reference Guide SHASUM(1)NAME
shasum - Print or Check SHA Checksums
SYNOPSIS
Usage: shasum [OPTION] [FILE]...
or: shasum [OPTION] --check [FILE]
Print or check SHA checksums.
With no FILE, or when FILE is -, read standard input.
-a, --algorithm 1 (default), 224, 256, 384, 512
-b, --binary read files in binary mode (default on DOS/Windows)
-c, --check check SHA sums against given list
-p, --portable read files in portable mode
produces same digest on Windows/Unix/Mac
-t, --text read files in text mode (default)
The following two options are useful only when verifying checksums:
-s, --status don't output anything, status code shows success
-w, --warn warn about improperly formatted SHA checksum lines
-h, --help display this help and exit
-v, --version output version information and exit
The sums are computed as described in FIPS PUB 180-2. When checking,
the input should be a former output of this program. The default mode
is to print a line with checksum, a character indicating type (`*'
for binary, `?' for portable, ` ' for text), and name for each FILE.
DESCRIPTION
The shasum script provides the easiest and most convenient way to compute SHA message digests. Rather than writing a program, the user
simply feeds data to the script via the command line, and waits for the results to be printed on standard output. Data can be fed to
shasum through files, standard input, or both.
The following command shows how easy it is to compute digests for typical inputs such as the NIST test vector "abc":
perl -e "print qw(abc)" | shasum
Or, if you want to use SHA-256 instead of the default SHA-1, simply say:
perl -e "print qw(abc)" | shasum -a 256
Since shasum uses the same interface employed by the familiar sha1sum program (and its somewhat outmoded anscestor md5sum), you can install
this script as a convenient drop-in replacement.
AUTHOR
Copyright (c) 2003-2008 Mark Shelor <mshelor@cpan.org>.
SEE ALSO
shasum is implemented using the Perl module Digest::SHA or Digest::SHA::PurePerl.
perl v5.12.5 2013-08-25 SHASUM(1)