Sponsored Content
Top Forums Shell Programming and Scripting Looping inside directories based on a file which contains file directory list Post 302716371 by RudiC on Tuesday 16th of October 2012 08:55:28 AM
Old 10-16-2012
Well, not knowing your system nor shell (which you did not mention), based on your examples and requirements, and hoping I understood and interpreted everything correctly, I've come up with this, which works on linux and bash:
Code:
#!/bin/bash
# set -vx
function grepit () {
                  eval $DIRS" | cut -d\" \" -f1 > pattfile"
                  grep -f pattfile $fn >$fn.grep
                 }

FIRST=1
DIRS="cat "
while read line
     do if [ "${line:0:3}" != "dir" ]
            then    [ "$FIRST" -eq "0" ] && grepit
                    fn=$line
                    FIRST=0
                    DIRS="cat "
            else    DIRS=$DIRS" "$line"/log*.txt"
       fi
     done <xyz.txt
grepit
rm pattfile

Results will finish up in respective "filename.grep". Pls. test and come back with results.

Last edited by RudiC; 10-16-2012 at 11:10 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

list file's by size order in sepecfied directory and sub directories

How do I list files of type "*.file" for example by size order recursively ? (2 Replies)
Discussion started by: ferretman
2 Replies

2. Shell Programming and Scripting

i want to delete a file based on existing file in a directory

hi i am having four files in a directory.like 1)sampleRej 2)exampleRej 3)samplemain 4)examplemain my requirement is i have to search for the rejected files (sampleRej,exampleRej) in a directory.if these files in that directory then i have to delete the main files... (3 Replies)
Discussion started by: srivsn
3 Replies

3. UNIX for Dummies Questions & Answers

creating separate directories according to file extension and keeping file in different directory as

unix program to which a directory name will be passed as parameter. This directory will contain files with various extensions. This script will create directories with the names of the extention of the files and then put the files in the corresponding folder. All files which do not have any... (2 Replies)
Discussion started by: Deekay.p
2 Replies

4. UNIX for Dummies Questions & Answers

create a file inside a directory

create a file inside a directory in one command like current directory is root i want to create a directory inside root and a file inside that directory is there any command like touch /d/d.txt d directory does not exist (1 Reply)
Discussion started by: abhisheklodha13
1 Replies

5. Shell Programming and Scripting

Compressing all directories inside a directory and remove the uncompressed version

hi pls give me a script to compress all directories inside a directory and remove the original uncompressed version... >> please also tell the single commmand to uncompress all the directories back...whemn needed (2 Replies)
Discussion started by: dll_fpga
2 Replies

6. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

7. Shell Programming and Scripting

List directories and count files inside

I'm trying to make a script that will list all directories under a selection as well as the number of files in each. I cannot get it to work under a symbolic link. The file structure is: XXX_20131127_001 dir01 (sym link) 2404x912 file.0000.xxx to ... (10 Replies)
Discussion started by: scribling
10 Replies

8. Shell Programming and Scripting

Getting all the subdirectories inside directories in excel file

Can anyone help me with a short command or script for the below scenario there is a path, /a/b/c/home?? Inside the above path there are number of subdirectories such as one two three four i need to take all the subdirectories inside home?? with full path. i need only one level of... (4 Replies)
Discussion started by: Little
4 Replies

9. Shell Programming and Scripting

How to delete all the files and folders inside all the directories except some specific directory?

hi, i have a requirement to delete all the files from all the directories except some specific directories like archive and log. for example: there are following directories such as A B C D Archive E Log F which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies

10. Shell Programming and Scripting

Search for a file in all directories and place the file in that directory

Hi All, Daily I am getting the updated file. I have to search for this file in all directories and sub directories. If the file existed in a particular directory then move this updated file to that particular directory. If the file is not existed in any of the directories then place this... (4 Replies)
Discussion started by: ROCK_PLSQL
4 Replies
mdassembler(1)						      General Commands Manual						    mdassembler(1)

NAME
mdassembler - Compile documentation for use in monodoc browser SYNOPSIS
mdassembler OPTIONS* DIRS+ DESCRIPTION
mdassembler has been obsoleted by mdoc(1). See the mdoc-assemble(1) man page. mdassembler is a program that creates .tree and .zip files for use in the monodoc documentation browser. The .tree and .zip files are copied into monodoc's sources directory, and reside with a .source file which is used by monodoc to specify where the documentation should be displayed. The .source file's /monodoc/source/@basefile attribute specifies the filename prefix for the documentation files. This must be the same prefix as used with the --out parameter. OPTIONS
--ecma The documentation found within DIRS is in the Mono ECMA documentation format. See the Mono ECMA Documentation Format section below. --ecmaspec The documentation found within DIRS is in the ECMA Specification documentation format. See the Mono ECMA Specification Documenta- tion Format section below. --error The documentation found within DIRS is in "error" format. See the Error Documentation Format section below. --help Show program argument information. --man The documentation found within DIRS is in man page format. See the Man Page Documentation Format section below. -o, --out PREFIX Specify the output file prefix. mdassembler creates the files PREFIX.zip and PREFIX.tree . --simple The documentation found within DIRS is in "simple" format. See the Simple Documentation Format section below. --xhtml, --hb The documentation found within DIRS is in XHTML format. See the XHTML Documentation Format section below. FORMATS
The following documentation formats are supported: Mono ECMA Documentation Format An XML documentation format with one file per type. See the mdoc(5) man page for more information. Mono ECMA Specification Documentation Format This is not the format you're looking for. This is the format used to represent the ECMA-334 (C#) standard within monodoc. It is not used to display class library documentation; for class library documentation, use the --ecma format. Error Documentation Format Used to present detailed error messages, and is used in monodoc's "C# Compiler Error Reference" tree. DIRS is not a directory, but is instead a configuration file, containing the XML: <ErrorProviderConfig> <FilesPath>../../mcs/errors</FilesPath> <Match>cs????*.cs</Match> <ErrorNumSubstringStart>2</ErrorNumSubstringStart> <ErrorNumSubstringLength>4</ErrorNumSubstringLength> <FriendlyFormatString>CS{0:0###}</FriendlyFormatString> </ErrorProviderConfig> /ErrorProviderConfig/FilesPath specifies where to look for files, /ErrorProviderConfig/Match specifies the filename pattern to look for within /ErrorProviderConfig/FilesPath, /ErrorProviderConfig/ErrorNumSubstringStart and /ErrorProviderConfig/ErrorNumSubstringLength control which portion of the filename is used as the error number, and /ErrorProviderConfig/FriendlyFormatString controls how the formatting/dis- play of the node in the monodoc tree. For each file found, it is converted to HTML with C# syntax coloring applied. Simple Documentation Format Converts text files into HTML by translating each newline into an HTML <br> element. Man Page Documentation Format Converts man pages into HTML for display. XHTML Documentation Format Copies the XHTML file as-is. EXAMPLES
To install your documenation for use with monodoc: Create a PREFIX.source file with the contents: <?xml version="1.0"?> <monodoc> <source provider="FORMAT" basefile="PREFIX" path="PATH"/> </monodoc> where FORMAT is the documentation format contained within the PREFIX.tree file, e.g. ecma, or simple. PREFIX is the basename of the .tree and .zip files that mdassembler creates. PATH is the "path" in the monodoc tree that should contain the documentation. See the @prefix@/lib/monodoc/monodoc.xml file for a list of PATH values (the //node/@name values). See also: http://www.mono-project.com/Generating_Documentation Create your documentation See also the monodocer(1) man page, e.g. monodocer -assembly:foo.dll -path:foo/en Assemble the documentation mdassembler --ecma foo/en PREFIX Make sure that you use the same PREFIX here as you did above. Install the documentation by using the command cp PREFIX.source PREFIX.tree PREFIX.zip `pkg-config monodoc --variable=sourcesdir` (Note the backticks used in the pkg-config command!) This copies the .source , .tree , and .zip files into the monodoc sources directory, which will allow monodoc to display the documentation. SEE ALSO
mdcs2ecma(1), mdnormalizer(1), mdoc(1), mdoc-assemble(1), mdvalidator(1), monodocer(1), monodocs2html(1) MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. WEB SITE
See also: http://www.mono-project.com and http://www.mono-project.com/Assembler mdassembler(1)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy