The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cksum dependencies vibhor_agarwali UNIX for Advanced & Expert Users 3 09-05-2007 03:38 AM
using cksum leeRoberts2007 Shell Programming and Scripting 4 05-31-2007 10:30 PM
cksum question rjsha1 Shell Programming and Scripting 4 01-17-2006 11:44 AM
Anyone know how cksum works? kapolani Shell Programming and Scripting 5 10-28-2004 10:46 AM
cksum parts of a file crazykelso UNIX for Dummies Questions & Answers 6 07-30-2002 12:38 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-14-2006
Dim-Wit Dim-Wit is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 18
The cksum Problem

Hi,

I have a working script, well it works on my machine but when I try it on others the cksum section does not work properly (I know the scripting is not of a high quality but I'm just trying to get it working)

Heres the script:

#!/bin/sh

case $# in
0) echo "usage: enshar filename filename2 ...";;

*) for file
do

if [ -d $file ]
then echo "usage: cannot shar directory"

elif [ ! -f $file ]
then echo "usage: file does not exist"

elif [ ! -r $file ]
then echo "usage: file is not readable"

else
echo "cat > $file <<\!EnShAr!"
cat $file
echo "!EnShAr!"
echo "set 'cksum $file'"
cksum $file > temp1
awk '/^/ {print $1}' temp1 > temp2
echo "test \$1 =" > temp1
more temp2 >> temp1
echo "|| echo \$0: BAD checksum in $file >&2" >> temp1
tr "\n" " " < temp1 > temp2
more temp2
echo
fi

done ;;

esac


My problem is: I need to get cksum to function properly, I need it to check the file before transfer, then after and display the number ( in some cases in just shows ::::::::: ), any help is very appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0