#!/mod/bin/jimsh foreach df [split [exec df -h] "\n\r"] { if [string match *sda2* $df] { regsub -all -- {[[:space:]]+} $df " " df set fields [split $df] set size [lindex $fields 1] set used [lindex $fields 2] set perc [string trimright [lindex $fields 4] "%"] } } set file [format "%02d" [expr {$perc * 25 / 100 + 1}]] puts "
" puts "" puts "
" puts "" puts "
" puts "Total space: $size
" puts "Used: $used ($perc%)" puts "
"