Sponsored Content
Full Discussion: Regex to remove subdirectory
Top Forums Shell Programming and Scripting Regex to remove subdirectory Post 302367882 by Scrutinizer on Tuesday 3rd of November 2009 04:50:44 PM
Old 11-03-2009
Assuming there are only subdirectories in $DIRECTORY that start with "fs", this should work:
Code:
find $DIRECTORY/fs*/* -type d -printf "'%p'\n"|sort -r |xargs rmdir 2>&-

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

regex to remove text before&&after comma chars

Hi, all: I have a question about "cleaning up" a huge file with regular expression(s) and sed: The init file goes like this: block1,blah-blah-blah-blah,numseries1,numseries2,numseries3,numseries4 block2,blah-blah-blah-blah-blah,numseries,numseries2,numseries3,numseries4 ...... (3 Replies)
Discussion started by: yomaya
3 Replies

2. Shell Programming and Scripting

regex to remove commentaries and blanks

Hi all, I need to prune a var's content as follows: VAR='blah blah # seew seew' NEWVAR='blah blah' (without blanks) I need also to perform this change by using variable substitution within bash shell. I've tried it with the following subst: VAR2=${VAR/ \#*/} but the... (7 Replies)
Discussion started by: yomaya
7 Replies

3. Shell Programming and Scripting

Using Sed to remove part of line with regex

Greetings everyone. Right now I am working on a script to be used during automated deployment of servers. What I have to do is remove localhost.localdomain and localhost6.localdomain6 from the /etc/hosts file. Simple, right? Except most of the examples I've found using sed want to delete the entire... (4 Replies)
Discussion started by: msarro
4 Replies

4. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

5. Shell Programming and Scripting

find regex and remove #

hi , how do i remove # from a line where i found regex.. don't need to remove all the line.. only remove comment.. (3 Replies)
Discussion started by: Poki
3 Replies

6. Shell Programming and Scripting

Perl regex to remove a segment in a line

Hello, ksh on Sun5.8 here. I have a pipe-delimited, variable length record file with sub-segments identified with a tilda that we receive from a source outside of our control. The records are huge, and Perl seems to be the only shell that can handle the huge lines. I am new to Perl, and am... (8 Replies)
Discussion started by: gary_w
8 Replies

7. Shell Programming and Scripting

Need regex shell script to remove text from file

Hello I am trying to remove a line like <?php /*versio:2.05*/if (!defined('determinator')){ content goes here}?> Now i want to scan all... (6 Replies)
Discussion started by: devp
6 Replies

8. Shell Programming and Scripting

Remove all files except the subdirectory(without pattern) in a directory

I used rm * and it deleted the files in the directory but gives and error message for unsuccessful subdirectory deletion. "rm: cannot remove 'DirectoryName': Is a directory" I dont want to explicitly get the above error. What are the modifications I have to do in the rm command? (3 Replies)
Discussion started by: duplicate
3 Replies

9. Shell Programming and Scripting

Perl, RegEx - Help me to understand the regex!

I am not a big expert in regex and have just little understanding of that language. Could you help me to understand the regular Perl expression: ^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{ ------ This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies

10. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works: LOCAL_CONFIG # Kcheckaddress regex -a@MATCH +<@+?\.++?\.(us|info|to|br|bid|cn|ru) LOCAL_RULESETS SLocal_check_mail # check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
remove group(1m)														  remove group(1m)

NAME
remove group - Removes all group members and the group from the specified name service entry SYNOPSIS
rpccp remove group group-entry-name [-s syntax] OPTIONS
Indicates the name syntax of the entry name (optional). The only value for this option is the dce name syntax, which is the default name syntax. Until an alternative name syntax becomes available, specifying the -s option is unnecessary. ARGUMENTS
Indicates the name of the target group. For an entry in the local cell, you can omit the cell name and specify only the cell-relative name. DESCRIPTION
The remove group command removes a group from the name service database. The group need not be empty. The entry name of the group is required. Privilege Required You need write permission to the CDS object entry (the target group entry). NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The following commands run RPCCP and remove the group from the name service entry /.:/LandS/anthro/Calendar_group: $ rpccp rpccp> remove group /.:/LandS/anthro/Calendar_group RELATED INFORMATION
Commands: add member(1m), remove member(1m), show group(1m) remove group(1m)
All times are GMT -4. The time now is 11:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy