diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-01-08 13:46:13 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-01-08 13:46:13 -0500 |
commit | 599ca0c2c1d3562b7090884ad237b83cf792a5ff (patch) | |
tree | 04a10068d05e37056966c444269aec7201eddc53 /kvm-status | |
parent | 20432e8cb24528b006c174cf598559f268ffe035 (diff) | |
download | kvm-manager-599ca0c2c1d3562b7090884ad237b83cf792a5ff.tar.gz kvm-manager-599ca0c2c1d3562b7090884ad237b83cf792a5ff.tar.bz2 |
avoid use of temp files in kvm-status
Diffstat (limited to 'kvm-status')
-rwxr-xr-x | kvm-status | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -14,15 +14,14 @@ function convert_ram { fi } -temp=$(mktemp) -echo "SERVER RAM" > "$temp" -total_ram=0 -for foo in $(ls $dir); do - ram=$(cat $dir/$foo/env/RAM) - convert_ram "$ram" - echo "$foo $display_ram" >> "$temp" - total_ram=$(( $total_ram + $display_ram )) -done -echo "TOTAL $total_ram" >> "$temp" -column -t "$temp" -rm "$temp" +{ + echo "SERVER RAM" + total_ram=0 + for foo in $(ls $dir); do + ram=$(cat $dir/$foo/env/RAM) + convert_ram "$ram" + echo "$foo $display_ram" + total_ram=$(( $total_ram + $display_ram )) + done + echo "TOTAL $total_ram" +} | column -t |