source: BOOK/filesize.sh@ b754e35

clfs-3.0.0-sysvinit sysvinit
Last change on this file since b754e35 was 78a84e5, checked in by Jim Gifford <clfs@…>, 16 years ago

Fixed patch sizes

  • Property mode set to 100755
File size: 408 bytes
RevLine 
[cc73be6]1#!/bin/bash
2
3FILENAME=$1
4
5if [ "${FILENAME}" = "" ]; then
6 echo "To Calculate the proper file size use the following command."
7 echo "$0 filename"
8 exit 255
9else
[78a84e5]10 FILESIZE=$(ls -l ${FILENAME} | cut -f5 -d' ')
[cc73be6]11 ((size=${FILESIZE}/1024))
[78a84e5]12 if [ "${size}" = "0" ]; then
13 size=$(echo .$(echo ${FILESIZE} | cut -b1))
14 fi
[cc73be6]15 FILEMD5SUM=$(md5sum ${FILENAME})
16
17 echo "${size} KB"
18 echo "${FILEMD5SUM}"
19fi
Note: See TracBrowser for help on using the repository browser.