source: clfs-embedded/BOOK/filesize.sh@ c2e79fa9

Last change on this file since c2e79fa9 was a4733fb, checked in by Jim Gifford <clfs@…>, 16 years ago

File Size Updates. Typo Fixes

  • 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.