Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PWD=$(pwd)
- echo "C remove. Delete all files without extention and *.o"
- echo "Work dir: [$PWD]"
- if (whiptail --title "Answer please Yes/No" --yesno "Do you realy wan't delete all files without extention in $PWD" 10 60) then
- ##echo "You chose Yes. Exit status was $?."
- echo "Delete files without extention";
- files=$(ls | grep -v '\.')
- for entry in $files
- do
- if [ $entry = "Makefile" ]; then
- echo "No delete Makefile"
- else
- echo "Delete file "$entry
- rm -f $entry
- fi
- done
- echo "Delete files with .o extention";
- rm -f *.o
- else
- echo "Exit whithout action. Exit status=$?"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement