Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deletes those files in a directory ? Post 302402888 by krishnampkkm on Wednesday 10th of March 2010 11:48:07 PM
Old 03-11-2010
Thank you mr. karthigayan'

Now the script works fine.....Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multi line deletes

I would like to be able to delete the first n lines of a file from inside of a ksh script. I am not sure how to achieve this or if it is possible. Could someone please help. Thanks in advance. (5 Replies)
Discussion started by: rehoboth
5 Replies

2. Shell Programming and Scripting

Shell Program which deletes all lines ...

Shell Program which deletes all lines containing the word "UNIX" in the files supplied as argument..please help me to do this task :) (4 Replies)
Discussion started by: abhiseknitd
4 Replies

3. UNIX for Advanced & Expert Users

Why rsync deletes source directory?

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets... (1 Reply)
Discussion started by: travegre
1 Replies

4. UNIX for Advanced & Expert Users

rsync deletes original directory

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted... (4 Replies)
Discussion started by: travegre
4 Replies

5. Shell Programming and Scripting

A script that deletes files.

I want to write a script that deletes files inside the dir. However, the script should also allow the user to confirm by pressing (d) key before deleting files.. #!/bin/bash for file in $1/* do size='ls -l $file | cut -f 5 -d " "' name='ls -l $file | cut -f 9 -d " "' ... (1 Reply)
Discussion started by: herberwz
1 Replies

6. UNIX for Advanced & Expert Users

MAKE-like build that deletes orphans?

I have a complex multi-stage (media conversion and formatting) build process that leaves orphan target files needing deleting automatically (i.e. by reference only to the build rules themselves, not any parallel config) upon each regular build. Since MAKE cannot do this, what can? Thanks. (4 Replies)
Discussion started by: chrisjj
4 Replies

7. Slackware

Thunderbird 3.1.9 deletes from drafts

I am using Tbird as it came with Slackware 13.37 and everytime I send something I get a message 1 or 2 drafts deleted. Should it be doing that? If not has this been reported ? How can I find out if it was reported? I have no drafts to delete. (2 Replies)
Discussion started by: slak0
2 Replies

8. Solaris

rm -rf not able deletes file but not the directory

i am trying to remove a directory using rm -rf command but its not getting removed.. it doesnt throw any error also.. i am logging as the owner of the dir and removing it but still no luck.. i am able remove a file but not a directory. i am using solaris 10 (12 Replies)
Discussion started by: chidori
12 Replies

9. UNIX for Dummies Questions & Answers

Command rm deletes filename but not the blocks

Hi It happens when I try to delete a file of 250MB with the command rm -r on our old Intergraph CLIX that the filename disappears while the blocks remain on the machine. Only when I reboot the system the blocks really disappear. Then rm works again for sometime but after some time it happens... (15 Replies)
Discussion started by: hausi2012
15 Replies

10. Shell Programming and Scripting

Directory containing files,Print names of the files in the directory that are exactly same content.

Given a directory containing say a few thousand files, please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents. func(a_directory_name) output -> {“matches”: , ... ]} e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies
Tree(3) 						User Contributed Perl Documentation						   Tree(3)

NAME
Tk::Tree - Create and manipulate Tree widgets SYNOPSIS
use Tk::Tree; $tree = $parent->Tree(?options?); SUPER-CLASS The Tree class is derived from the HList class and inherits all the methods, options and subwidgets of its super-class. A Tree widget is not scrolled by default. STANDARD OPTIONS
Tree supports all the standard options of an HList widget. See Tk::options for details on the standard options. WIDGET-SPECIFIC OPTIONS Name: browseCmd Class: BrowseCmd Switch: -browsecmd Specifies a callback to call whenever the user browses on an entry (usually by single-clicking on the entry). The callback is called with one argument, the pathname of the entry. Name: closeCmd Class: CloseCmd Switch: -closecmd Specifies a callback to call whenever an entry needs to be closed (See "BINDINGS" below). This method is called with one argument, the pathname of the entry. This method should perform appropriate actions to close the specified entry. If the -closecmd option is not specified, the default closing action is to hide all child entries of the specified entry. Name: command Class: Command Switch: -command Specifies a callback to call whenever the user activates an entry (usually by double-clicking on the entry). The callback is called with one argument, the pathname of the entry. Name: ignoreInvoke Class: IgnoreInvoke Switch: -ignoreinvoke A Boolean value that specifies when a branch should be opened or closed. A branch will always be opened or closed when the user presses the (+) and (-) indicators. However, when the user invokes a branch (by doublc-clicking or pressing <Return>), the branch will be opened or closed only if -ignoreinvoke is set to false (the default setting). Name: openCmd Class: OpenCmd Switch: -opencmd Specifies a callback to call whenever an entry needs to be opened (See "BINDINGS" below). This method is called with one argument, the pathname of the entry. This method should perform appropriate actions to open the specified entry. If the -opencmd option is not specified, the default opening action is to show all the child entries of the specified entry. DESCRIPTION
The Tree method creates a new window and makes it into a Tree widget and return a reference to it. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the Tree widget such as its cursor and relief. The Tree widget can be used to display hierarchical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree. To display a static tree structure, you can add the entries into the Tree widget and hide any entries as desired. Then you can call the autosetmode method. This will set up the Tree widget so that it handles all the open and close events automatically. the demonstration program Tixish/examples/perl-tix-tree). The above method is not applicable if you want to maintain a dynamic tree structure, i.e, you do not know all the entries in the tree and you need to add or delete entries subsequently. To do this, you should first create the entries in the Tree widget. Then, use the setmode method to indicate the entries that can be opened or closed, and use the -opencmd and -closecmd options to handle the opening and closing events. (Please see the demonstration program Tixish/examples/perl-tix-dyntree). Use either $parent->Scrolled('Tree', ... ); or $parent->ScrlTree( ... ); to create a scrolled Tree. See Tk::Scrolled for details. WIDGET METHODS
The Tree method creates a widget object. This object supports the configure and cget methods described in Tk::options which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic Tk::Widget class. The following additional methods are available for Tree widgets: $tree->add_pathimage(treeRegExp [, openImg, closeImg]) This method defines images for a given path (images must be in xpm format). The path can be determined by a simplified regular expression. There are just three metasymbols: ^ at the beginning of the "treeRegExp" same as in Perl regular expressions * anything $ at the end of the "TreeRegExp", the same as in Perl regular expressions Examples: $tree->add_pathimage('^root','openfolder','folder'); matches "root", "root.foo", "root.bar", but not "foo.root" $tree->add_pathimage('root.*.class','openfolder','folder'); matches all paths containing "root.<anything>.class", but not "root.<anything>.<anything>.class" "*" is one part of the path. If you want to use a wildcard for two steps, you have to use "*.*". $tree->add_pathimage('class$','openfolder','folder'); This matches all path with "class" at the end. $tree->autosetmode This method calls the setmode method for all the entries in this Tree widget: if an entry has no child entries, its mode is set to none. Otherwise, if the entry has any hidden child entries, its mode is set to open; otherwise its mode is set to close. $tree->child_entries([$path][,$depth]) This method returns in list context an array that contains all pathnames of subentries within the given path. In scalar context it returns the number of subentries in the given path. Example: root | foo | bar | | bar1 | | bar2 my @childentries = $tree->child_entries('root.bar'); # returns (root.bar.bar1, root.bar.bar2) my $nr_of_subentries = $tree->child_entries('root',2); # returns 4 If $path is omitted, all it is assumed, that the entry above 'root' is meant. $depth defines the numbers of levels. $tree->close(entryPath) Close the entry given by entryPath if its mode is close. $tree->getmode(entryPath) Returns the current mode of the entry given by entryPath. $tree->open(entryPath) Open the entry given by entryPath if its mode is open. $tree->setmode(entryPath, mode) This method is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next to the entry. If mode is set to close, a (-) indicator is drawn next to the entry. If mode is set to none, no indicators will be drawn for this entry. The default mode is none. The open mode indicates the entry has hidden children and this entry can be opened by the user. The close mode indicates that all the children of the entry are now visible and the entry can be closed by the user. BINDINGS
The basic mouse and keyboard bindings of the Tree widget are the same as the bindings of the HList widget. In addition, the entries can be opened or closed under the following conditions: [1] If the mode of the entry is open, it can be opened by clicking on its (+) indicator. [2] If the mode of the entry is close, it can be closed by clicking on its (-) indicator. SEE ALSO
Tk::HList AUTHOR
Perl/TK version by Chris Dean <ctdean@cogit.com>. Original Tcl/Tix version by Ioi Kim Lam. Additions by Renee Baecker <module@renee-baecker.de> ACKNOWLEDGEMENTS
Thanks to Achim Bohnet <ach@mpe.mpg.de> for all his help. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 153: Expected text after =item, not a bullet perl v5.16.3 2014-06-10 Tree(3)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy