show2cp is controlable via argument
This commit is contained in:
parent
19f30c13e6
commit
389312ed8c
8
show2cp
8
show2cp
@ -1,15 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
md5=$1
|
||||||
|
[ -z "$md5" ] && md5=2cp
|
||||||
|
[ -f "$md5" ] || { echo "ERROR: $md5 not found"; exit 255; }
|
||||||
|
|
||||||
function calc_kb() {
|
function calc_kb() {
|
||||||
i=0
|
i=0
|
||||||
cat 2cp | cut -c 35- | while read line; do
|
cat $1 | cut -c 34- | while read line; do
|
||||||
kb=$(du "$line" | cut -f 1)
|
kb=$(du "$line" | cut -f 1)
|
||||||
i=$((i+kb))
|
i=$((i+kb))
|
||||||
echo $i
|
echo $i
|
||||||
done | tail -n1
|
done | tail -n1
|
||||||
}
|
}
|
||||||
|
|
||||||
kb=$(calc_kb)
|
kb=$(calc_kb "$md5")
|
||||||
mb=$((kb/1024))
|
mb=$((kb/1024))
|
||||||
gb=$((mb/1024))
|
gb=$((mb/1024))
|
||||||
tb=$((gb/1024))
|
tb=$((gb/1024))
|
||||||
|
Loading…
Reference in New Issue
Block a user