08-12-2008
Do you not need to know which file each checksum belongs to? You can easily just pull out the checksum column by adding | awk '{print $1}' to the pipeline.
Incidentally I would recommend using cksum or md5sum rather than sum, which has a very simplistic checksum algorithm.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Gurus -
I got one simple TXT file with long file name with blank spaces in between the words. I am trying to display that full file name, but it breaks while displaying. Could somebody shed some light here?
Script
------
for i in `cat ~\temp\employee.txt`
do
echo $i
done (5 Replies)
Discussion started by: Eric_2005
5 Replies
2. Shell Programming and Scripting
hi i wrote following script,
#!/usr/bin/sh
for index in `ls /tmp/common/*.txt`
do
echo "$index"
done
here index is giving full path but in my program i want only file names (not along with whole path)
Eg. if in /tmp/common files are a.txt and b.txt den out should be a.txt b.txt
... (6 Replies)
Discussion started by: crackthehit007
6 Replies
3. Shell Programming and Scripting
Hi All,
I have spaces in between file names.
"Material Header.txt"
"Customer Header.txt"
"Vendor Header.txt"
And how can I remove spaces between file names like below
MaterialHeader.txt
CustomerHeader.txt
VendorHeader.txt
Thanks
Srimitta (10 Replies)
Discussion started by: srimitta
10 Replies
4. Shell Programming and Scripting
Hello, I'm a computer science major and I'm having problems dealing with file names with spaces in them. Particularly I'm saving a file name in a variable and then using the variable in a compare function i.e.
a='te xt.txt'
b='file2.txt'
cmp $a $b
If anyone could help me with this particular... (10 Replies)
Discussion started by: jakethegreycat
10 Replies
5. Shell Programming and Scripting
please somebody tell me what is wrong with this, while the thumbnail grabbing works and encoding works, but what is not working is, mv $i.jpg /var/www/thumbs/ and mv $i.mp4 /var/www/uploads/
#!/bin/bash
# MINT 9 - FFMPEG - QT-FASTSTART - X264 - MP4
DIR=/var/www/tmp
for i in... (9 Replies)
Discussion started by: mysoogal
9 Replies
6. Shell Programming and Scripting
I'm trying to search for all files in directory with particular GID then change the GID to match the UID of each file:
#!/bin/sh
for i in $(find /dump -gid 200 | sed 's/\ /\\\ /g' | sed 's/\&/\\\&/g'); do
chgrp $(ls -ln ${i} | awk '{print $3}') ${i}
done
I'm using sed to deal with... (7 Replies)
Discussion started by: venmx
7 Replies
7. UNIX for Advanced & Expert Users
Hey Guys ,
Recently working on a requirement , i had to deal with XLS file with multiple tabs and the requirement was as below :
1. Convert one XLS file with multiple tabs to multiple CSV files.
-- As i was working on MAC , so it was quite easy through APPLESCRIPT to deal with this.But... (2 Replies)
Discussion started by: himanshu sood
2 Replies
8. Shell Programming and Scripting
The following command to replace text in place in multiple files in a directory is tripping up on filename spaces (Windows environment). I really don't know Perl.
find '\\server\directory' | xargs perl -pi -e 's/textA/textB/g'Mike (2 Replies)
Discussion started by: Michael Stora
2 Replies
9. UNIX for Advanced & Expert Users
Hi,
I am having issues with the jar -tf command when I put in the shell script.
The command runs fine from the command line as shown below.
# jar -tf "./VirtualBox Dropped Files/2016-04-17T20:58:49.129139000Z/hive-exec-0.8.1.jar"
But when I put in a shell script(shown below) and the... (10 Replies)
Discussion started by: vinoo128
10 Replies
10. SCO
I am downloading a zip file that contain files that are very long. I am trying to process them, but cannot. I can move the files from one directory to another at the shell prompt, but not within a shell script, I get a stat error.
The files look somewhat like this;
... (5 Replies)
Discussion started by: trolley
5 Replies
sum(3tcl) Cyclic Redundancy Checks sum(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
sum - Calculate a sum(1) compatible checksum
SYNOPSIS
package require Tcl 8.2
package require sum ?1.1.0?
::crc::sum ?-bsd | -sysv? ?-format fmt? ?-chunksize size? [ -filename file | -channel chan | string ]
_________________________________________________________________
DESCRIPTION
This package provides a Tcl-only implementation of the sum(1) command which calculates a 16 bit checksum value from the input data. The
BSD sum algorithm is used by default but the SysV algorithm is also available.
COMMANDS
::crc::sum ?-bsd | -sysv? ?-format fmt? ?-chunksize size? [ -filename file | -channel chan | string ]
The command takes string data or a file name or a channel and returns a checksum value calculated using the sum(1) algorithm. The
result is formatted using the format(3tcl) specifier provided or as an unsigned integer (%u) by default.
OPTIONS
-sysv The SysV algorithm is fairly naive. The byte values are summed and any overflow is discarded. The lowest 16 bits are returned as the
checksum. Input with the same content but different ordering will give the same result.
-bsd This algorithm is similar to the SysV version but includes a bit rotation step which provides a dependency on the order of the data
values.
-filename name
Return a checksum for the file contents instead of for parameter data.
-channel chan
Return a checksum for the contents of the specified channel. The channel must be open for reading and should be configured for
binary translation. The channel will no be closed on completion.
-chunksize size
Set the block size used when reading data from either files or channels. This value defaults to 4096.
-format string
Return the checksum using an alternative format template.
EXAMPLES
% crc::sum "Hello, World!"
37287
% crc::sum -format 0x%X "Hello, World!"
0x91A7
% crc::sum -file sum.tcl
13392
AUTHORS
Pat Thoyts
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category crc of
the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for
either package and/or documentation.
SEE ALSO
cksum(3tcl), crc32(3tcl), sum(1)
KEYWORDS
checksum, cksum, crc, crc32, cyclic redundancy check, data integrity, security, sum
CATEGORY
Hashes, checksums, and encryption
COPYRIGHT
Copyright (c) 2002, Pat Thoyts <patthoyts@users.sourceforge.net>
crc 1.1.0 sum(3tcl)