Sponsored Content
Full Discussion: Menu for Purge
Top Forums Shell Programming and Scripting Menu for Purge Post 302887934 by sea on Tuesday 11th of February 2014 05:27:22 PM
Old 02-11-2014
Code:
ask() { # "Question to ask"
# Ask a question (y/n)
# Returns 0 for yes, 1 for no
    read -n1 -p "$1 (y/n): " ANSWER
    [ [yjso] = "$ANSWER" ] && return 0 || return 1
    # Returns YES (0) for yes, si, oui, ja (first letters)
}

BASE=/some/dir
cd $BASE

for FOUND in $(find . -name);do     ### might become ARG_MAX, but you said its only ~25
    [ -d $FOUND ] && \
       ask "Delete: $FOUND and all subdirectories?" && \
       rm -fr $FOUND
done

Hth & gn8
Do on your own risk - untested too tired on windows...
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

purge xterm

Being new I had my focus in the wrong place and typed in xterm instead of <If you can't guess, good>. Can I purge xterm so that this word no longer appears using up or down arrows? (1 Reply)
Discussion started by: noobie_doo
1 Replies

2. Shell Programming and Scripting

script for purge

Hi , I want to purge 7 days older data from a list of data sorted on date in a log file... Can anyone provide me with the shell script for the same.. Thanks, Jaz (1 Reply)
Discussion started by: JP003
1 Replies

3. Shell Programming and Scripting

script to archive and purge

Hi, I am writing a shell script for archive data from a table. The design is as follows. Step 1: Execute the select query and extract the data into a text file. Step 2: The primary key for this table is TRACKING_NUM, TRACKING_NUM_SUFFIX, TIMESTAMP_UPDATED. So These three fields will be read... (1 Reply)
Discussion started by: kmanivan82
1 Replies

4. Shell Programming and Scripting

Menu in Menu script issue

Problem: I am trying to create a menu in a menu script and I am running into an issue with the calculator portion of the script. I am first presented with the ==Options Menu== which all 5 options working correctly. Now comes the fun part. I select option 1 which takes me to my ==Calculator... (1 Reply)
Discussion started by: iDdraig
1 Replies

5. UNIX for Advanced & Expert Users

Purge MAil file

Hi, merry christmas. on AIX 6.1, the file /var/spool/mail/user, should/can be purged manually ? Any commande line to purge it ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

6. Emergency UNIX and Linux Support

Purge in oracle9i

From morning we are facing some issues in tablespaces in oracle9i. Tried deleting some huge records... but even thought it is still giving tablespcases in full. Then i tried and googling ... found we need to purge recyclebin of oracle.. but thats not woking in oracle9i... can any one... (1 Reply)
Discussion started by: greenworld123
1 Replies

7. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

8. UNIX for Beginners Questions & Answers

Gnome 3.28.3 menu item dissapears under the system menu

I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome. Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies
DWWW-BUILD-MENU(8)						      Debian							DWWW-BUILD-MENU(8)

NAME
dwww-build-menu - builds dwww Debian Documentation Menu SYNOPSIS
dwww-build-menu DESCRIPTION
dwww-build-menu is part of the dwww package, which provides access to on-line documentation on a Debian system via WWW. dwww-build-menu generates the Debian Documentation Menu pages (available on http://localhost/dwww/menu/), from files registered with doc-base program, found in the /var/lib/doc-base/documents The generated pages are stored in DWWW_DOCROOTDIR/dwww/menu directory. (Default is /var/www/dwww/menu.) FILES
/etc/dwww/dwww.conf Configuration file for dwww. /var/www/dwww/menu Default directory for generated menu pages. /var/lib/dwww Temporary directory used while generating the pages. SEE ALSO
dwww(7), dwww-build(8), install-docs(8), Debian doc-base Manual in /usr/share/doc/doc-base/doc-base.html/index.html. AUTHOR
Robert Luberda <robert@debian.org>. See dwww(7) for copyrights and stuff. dwww 1.11.1 February 15th, 2009 DWWW-BUILD-MENU(8)
All times are GMT -4. The time now is 01:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy