Skip to content

Instantly share code, notes, and snippets.

@LightningStalker
Created November 22, 2025 11:03
Show Gist options
  • Select an option

  • Save LightningStalker/db671d48d19dbe9fb249ff586bd24fa8 to your computer and use it in GitHub Desktop.

Select an option

Save LightningStalker/db671d48d19dbe9fb249ff586bd24fa8 to your computer and use it in GitHub Desktop.
make you directry disappear
#!/bin/bash
if [ -d "${1}" ]
then
echo -n 'dirshma.sh: '
rename -v 'y/ -~/0/' "${1}"
until
echo -n 'dirshma.sh: '
rename -v 's/0//' 0*
rmdir 0 2> /dev/null
do
: # nothing
done
echo dirshma.sh: ${1} goed away
exit 0
elif [ -v ${1} ]
then
echo dirshma.sh: no arg
else
echo dirshma.sh: ${1} no exist or no is direcotry
fi
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment