I am using a DEC ALPHA running Digital UNIX (formly DEC OSF/1) and ksh. I have a directory with hundreds of files that only share the extension .rpt. I would like to search that directory based on serial number and operation number and only files that meet both requirements to be printed out. I... (6 Replies)
Please help. I am getting back into UNIX and I need a script that requires me to start in one main directory (call it mydata) and under this directory searches several subdirectories within subdirectories. I need to search each directory to locate *_source and delete files within the directory... (2 Replies)
Guys
I need to write a korn shell script that will search for a list of empty sub-directories in a specific directory and then email a list of these empty directories.
Any ideas - apologies, I am new to shell scripting.
Thanks (4 Replies)
Hi
I was wondering why command 2 doesn't work like command 1 below.
1.
find . -exec grep "test" '{}' \; -print
2.
ls -R | grep "test"
I am trying to search "test" from all the files in the current and sub directories. What's wrong with my command 2?
Thanks in advance for your help (4 Replies)
Hi,
I am searching for a file named "Backup.txt" but I don't know in which directory it is.
Can someone tell me, how I can search recursiv in all directories and subdirectories?
thanks (2 Replies)
Hi ,
I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory.
how to write this in a simple script, I have made my code complex
if ; then
taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
I use this command to find a search (Nr of active alarms are) and print one line before and 10 lines after the search keywords.
nawk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print;c=a}b{r=$0}' b=1 a=10 s="Nr of active alarms are:" *.log
However, I would like to know how to tell it to print... (3 Replies)
Hi,
I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them.
Each of... (20 Replies)
Hi,
Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly.
I have directories (eg 40001, 40002, etc) that each have one subdirectory (01).
Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir.
I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies
LEARN ABOUT DEBIAN
fnpathfind
FNPATHFIND(3pub) C Programmer's Manual FNPATHFIND(3pub)NAME
fnpathfind - find a file in a list of directories
SYNOPSIS
#include <publib.h>
int fnpathfind(const char *path, const char *tgt,
char *res, size_t max);
DESCRIPTION
pathfind looks for a file in a list of directories. The argument `path' is a colon separated list of directories, typically the contents
of an environment variable like PATH, MANPATH, or CDPATH. The function will go through the directories in the path and look in each direc-
tory for a file given in argument `target' until it finds it. Only an exact match is reported, no wild cards or globbing.
The names that are matched are formed by taking an element from the path and prepending it to target. An empty element means the current
directory, as does the name ".".
The function returns -1 for failure (not found or error), or the total size for the full name (the full name may have been truncated when
stored into result).
BUGS
The function uses dynamic memory allocation and may therefore fail due to insufficient memory.
It is not trivial to know in which directory the search ended. This makes is difficult to continue the search.
SEE ALSO publib(3), fname(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual FNPATHFIND(3pub)