Fix the new summarize feature on check-trash.
This commit is contained in:
parent
db3e610c91
commit
ae3112d969
@ -281,6 +281,7 @@
|
|||||||
unset OPTIND
|
unset OPTIND
|
||||||
unset clean
|
unset clean
|
||||||
unset network
|
unset network
|
||||||
|
du_params="-ha"
|
||||||
while (( $# > 0 )); do
|
while (( $# > 0 )); do
|
||||||
case $1 in
|
case $1 in
|
||||||
-c | -y | --clean )
|
-c | -y | --clean )
|
||||||
@ -288,7 +289,7 @@
|
|||||||
-n | -net | --network )
|
-n | -net | --network )
|
||||||
network="Y" ;;
|
network="Y" ;;
|
||||||
-s | -sum | --summarize )
|
-s | -sum | --summarize )
|
||||||
summarize="-s" ;;
|
du_params="-sh" ;;
|
||||||
* )
|
* )
|
||||||
echo "
|
echo "
|
||||||
ERROR: Option '$1' with value '$2' not recognized.
|
ERROR: Option '$1' with value '$2' not recognized.
|
||||||
@ -322,7 +323,7 @@
|
|||||||
$sudo find $dir -name TRASH | while read trash; do
|
$sudo find $dir -name TRASH | while read trash; do
|
||||||
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash:"
|
echo "Found $trash:"
|
||||||
$sudo du -ha $summarize $trash | sort -h
|
$sudo du $du_params $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -332,7 +333,7 @@
|
|||||||
$sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do
|
$sudo find $dir $maxdepth -name "*"Trash"*" | while read trash; do
|
||||||
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `$sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash:"
|
echo "Found $trash:"
|
||||||
$sudo du -ha $summarize $trash | sort -h
|
$sudo du $du_params $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
$sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -349,7 +350,7 @@
|
|||||||
sudo find $dir -name TRASH | while read trash; do
|
sudo find $dir -name TRASH | while read trash; do
|
||||||
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash:"
|
echo "Found $trash:"
|
||||||
sudo du -ha $summarize $trash | sort -h
|
sudo du $du_params $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
@ -359,7 +360,7 @@
|
|||||||
sudo find $dir -name .Trash"*" | while read trash; do
|
sudo find $dir -name .Trash"*" | while read trash; do
|
||||||
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
if [[ "$trash" != "" && `sudo ls -a $trash` ]]; then
|
||||||
echo "Found $trash:"
|
echo "Found $trash:"
|
||||||
sudo du -ha $summarize $trash | sort -h
|
sudo du $du_params $trash | sort -h
|
||||||
if [[ "$clean" == "Y" ]]; then
|
if [[ "$clean" == "Y" ]]; then
|
||||||
echo "Cleaning trash..."
|
echo "Cleaning trash..."
|
||||||
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
sudo sh -c "cd $trash; rm -rfv ..?* .[!.]* *"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user