source: BOOK/filesize.sh@ c9f6a00

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

Fixed patch sizes

  • Property mode set to 100755
File size: 408 bytes
Line 
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
10 FILESIZE=$(ls -l ${FILENAME} | cut -f5 -d' ')
11 ((size=${FILESIZE}/1024))
12 if [ "${size}" = "0" ]; then
13 size=$(echo .$(echo ${FILESIZE} | cut -b1))
14 fi
15 FILEMD5SUM=$(md5sum ${FILENAME})
16
17 echo "${size} KB"
18 echo "${FILEMD5SUM}"
19fi
Note: See TracBrowser for help on using the repository browser.