mirror of
https://github.com/cross-lfs/clfs-embedded.git
synced 2025-08-03 15:39:06 +00:00
20 lines
408 B
Bash
Executable File
20 lines
408 B
Bash
Executable File
#!/bin/bash
|
|
|
|
FILENAME=$1
|
|
|
|
if [ "${FILENAME}" = "" ]; then
|
|
echo "To Calculate the proper file size use the following command."
|
|
echo "$0 filename"
|
|
exit 255
|
|
else
|
|
FILESIZE=$(ls -l ${FILENAME} | cut -f5 -d' ')
|
|
((size=${FILESIZE}/1024))
|
|
if [ "${size}" = "0" ]; then
|
|
size=$(echo .$(echo ${FILESIZE} | cut -b1))
|
|
fi
|
|
FILEMD5SUM=$(md5sum ${FILENAME})
|
|
|
|
echo "${size} KB"
|
|
echo "${FILEMD5SUM}"
|
|
fi
|