Sponsored Content
Top Forums Shell Programming and Scripting Find directory immediately after the pattern dir name Post 302997683 by Yuvaan12 on Thursday 18th of May 2017 06:30:33 AM
Old 05-18-2017
Find directory immediately after the pattern dir name

Hi,
From below directories path I need the directory which comes immediately after the "DataPath"

Code:
/var/errors/LogDefaultPath/DataPath/Data01/Data02    (Directory name "Data01" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Log01/Log0202    (Directory name "Log01" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Planning         (Directory name "Planning" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Support          (Directory name "Support" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Support/Contents  (Directory name "Support" is the result from this path)

Please help on this.
Thanks

Last edited by RudiC; 05-18-2017 at 09:23 AM.. Reason: Removed ICODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To find a character immediately following a word

Hello, I have data in one file like - UNB+UNOA:1+006415160:1+WF0000010188:ZZ+080701:0600+2++DELFOR++++T'UNH+2+DELFOR:D:97A:UN................ Now, I want to find what is the character immediately following UNB(here +) UNOA (here :) or the character immedialtely preceding UNH (here ') &... (2 Replies)
Discussion started by: The Observer
2 Replies

2. Shell Programming and Scripting

To find a character immediately following a specified String

Hello, I have a UNIX file in which data is like this -- ISA*00* *00* *01*006415160 *01*137361242 ... (3 Replies)
Discussion started by: The Observer
3 Replies

3. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

4. Shell Programming and Scripting

Find which dir is big size in a directory

Hi all, Could you please tellme the commadn which sorts the list of directories in a parent dir by their size. Thanks. (2 Replies)
Discussion started by: firestar
2 Replies

5. Shell Programming and Scripting

Deleting a type of file in a directory immediately it occurs

Hi All, I have to maintain few servers and in those servers in a specific directory some special jobs keeps on running ....... The directory is having many kind of files like.....acd*, hud*, rca*....bla bla bla....... My aim is that if due to any job-any time a file having initials like... (4 Replies)
Discussion started by: jitendra.pat04
4 Replies

6. UNIX for Dummies Questions & Answers

find the file names having specified pattern at specified position in the current directory

I would need a command for finding first 15000 of the file names whose 25th postion is 5 in the current directory alone. I do have this painful command find . -name '5*' | head -15000 | cut -c3- please refine this. Of course the above command also searches in the sub directories... (3 Replies)
Discussion started by: vk39221
3 Replies

7. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

8. Shell Programming and Scripting

How to find files in a pattern directory?

Hi, I have more than 1000 directories under one directory (lets says under /home/). Sub directories are like A1 to A100,B1 to B100 etc.. Here my problem is I need to find the files older than 10 days in the directories which starts with A*. I tried some thing like this which is not... (2 Replies)
Discussion started by: shhrikanth
2 Replies

9. Shell Programming and Scripting

Shell script to search a pattern in a directory and output number of find counts

I need a Shell script which take two inputs which are 1) main directory where it has to search and 2) pattern to search within main directory all files (.c and .h files) It has to print number of pattern found in main directory & each sub directory. main dir --> Total pattern found = 5 |... (3 Replies)
Discussion started by: vivignesh
3 Replies

10. Shell Programming and Scripting

To find ls of similar pattern files in a directory by passing the variable.

Hi, I have file in my $datadir as below :- SAT_1.txt SAT_2.txt BAT_UD.lst BAT_DD1.lst DUTT_1.txt DUTT_la.txt Expected result :- should get all the above file in $<Filename>_file.lst Below is my code :- for i in SAT BAT DUTT do touch a.lst cd $datadir (1 Reply)
Discussion started by: satishmallidi
1 Replies
MYPROXY-REPLICATE(8)					User Contributed Perl Documentation				      MYPROXY-REPLICATE(8)

NAME
myproxy-replicate - Stores data from the MyProxy master repository to all the slave servers. SYNOPSIS
myproxy-replicate [options] ... Options: [-verbose|-v] Print copious output [-help|-h] Print usage [-storage|-r]=<path to repository> Directory of the MyProxy repository. [-config|-c]=<path to config file> Directory of the MyProxy Server configuration file. [-debug|-d] Run in debug mode DESCRIPTION
myproxy-replicate Replicates data. This utility will read a specified MyProxy repository and send any new or changed data to a slave MyProxy server. The slave servers are specified in the myproxy-server.config(5) file. This utility will need to run at some specified interval in order to keep the slave repositories semi current with the Master repository. This can best be accomplished using cron, or some similar mechanism. OPTIONS
-v, -verbose Enables verbose debugging output to the terminal. -h, -help Displays command usage text and exits. -u, -usage Displays command usage text and exits. -r dir, -storage dir Specifies the location of the credential storage directory. The directory must be accessible only by the user running the myproxy- server process for security reasons. Default: /var/lib/myproxy or /var/myproxy or $GLOBUS_LOCATION/var/myproxyA -c file, -config file Specifies the location of the myproxy-server configuration file. Default: /etc/myproxy-server.config or $GLOBUS_LOCA-TION/etc/myproxy-server.config SEE ALSO
myproxy-init(1) myproxy-store(1) myproxy-retrieve(1) myproxy-delegate(1) myproxy-server(8) myproxy-server.config(5) AUTHOR
perl v5.8.4 2005-05-3 MYPROXY-REPLICATE(8)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy