09-20-2013
Thank you .. it worked..
Any idea why does it happened with exec ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have a shell script(ksh) which has the code as follows.
------------------
cd $mydir
for i in `find ./ -type f -mtime +$k`
do
echo $i
done
-----------------------
And in $mydir , i have some files which have space in theie names like "Case att15".
The out put of the... (6 Replies)
Discussion started by: rajugp1
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
Having a simple issue with find command on Sun. The command works fine if the variable is set to the actual filesystem but fails when the variable is set to a link which is pointing to the same filesystem.
export DUMPDEST=/oradata1/exports/pbm - Set the variable
... (2 Replies)
Discussion started by: win_vin
2 Replies
3. UNIX for Dummies Questions & Answers
Hi all, i'm new at shell scripting world...
I'm working on a script for searching old files on a server, this scripts runs with a configuration file wich indicates where to search the files, the script should search for all files that are older than an x qty of days, and the only clue that i have... (9 Replies)
Discussion started by: juanklavera
9 Replies
4. Shell Programming and Scripting
Hi,
I am issuing find command below mentioned ways but it givs different count. I don't understand the behaviour. Could any one have any clue?
$ find . -mtime -5 -maxdepth 1 -exec ls -lrt {} \; | wc -l
169
$ find . -mtime -5 -maxdepth 1 | wc -l
47
$ find . -mtime -5 -maxdepth 1 | wc -l... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies
5. UNIX for Dummies Questions & Answers
I am currently using below command to get the 1st three characters of a file(PDM). Issue is, when i use find command in root dir, it finds all the files in sub dir also.
How to limit the find command search to a given path only(ie: say only find file in apps/cmplus/datamigration/data path... (3 Replies)
Discussion started by: abhi_n123
3 Replies
6. Shell Programming and Scripting
Hi All,
I'm a bit new to Linux environment, moderately okay when it comes to Unix AIX. I'm facing an issue while trying to run a simple find command:
$ for file in `find . -name *.*`
> do
> ls $file
> done
This is throwing the following error:
Strangely, a few minutes... (4 Replies)
Discussion started by: adi_2_chaos
4 Replies
7. Linux
Hi,
I am not root user. I am trying to find the file which has contains pattern "fvsfile" in root directory.
If i run the find cmd then i got permission denied and all the files are listed include pattern files. i cant get file name yet
find . print | xargs grep -i "fvsfile"
I want... (2 Replies)
Discussion started by: Mani_apr08
2 Replies
8. Shell Programming and Scripting
Hi,
I have created a shell script for Server Log Automation Process. I have used
find xargs grep command to search the string.
for Example,
find -name | xargs grep "816995225" > test.txt .
Here my problem is,
We have lot of records and we want to grep the string... (4 Replies)
Discussion started by: nanthagopal
4 Replies
9. Shell Programming and Scripting
Guys,
Here is my requirement..
Sample.cfg
file="*log.gz *txt.gz"
sample.sh
#!/bin/sh
. $HOME/Sample.cfg
find . -name "$file" -mtime +20 -exec ls -la {} \;
Its not finding the given *log.gz and txt.gz files.
Could anyone please help me? (8 Replies)
Discussion started by: AraR87
8 Replies
10. Shell Programming and Scripting
Hi Guys,
I have a file called error.logs. am just trying to display the content in the file which was modified last 1 day. I tried below command but it doesnt give the proper output.
find /u/text/vinoth/bin "error.logs" -mtime -1 -exec cat {} \; >> mail.txt
Any help is much... (21 Replies)
Discussion started by: Vinoth Kumar G
21 Replies
LEARN ABOUT NETBSD
pthread_atfork
PTHREAD_ATFORK(3) BSD Library Functions Manual PTHREAD_ATFORK(3)
NAME
pthread_atfork -- register handlers to be called when process forks
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <pthread.h>
int
pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void));
DESCRIPTION
The pthread_atfork() function registers the provided handler functions to be called when the fork(2) function is called. Each of the three
handlers is called at a different place in the fork(2) sequence. The prepare handler is called in the parent process before the fork hap-
pens, the parent handler is called in the parent process after the fork has happened, and the child handler is called in the child process
after the fork has happened. The parent and child handlers are called in the order in which they were registered, while the prepare handlers
are called in reverse of the order in which they were registered.
Any of the handlers given may be NULL.
The intended use of pthread_atfork() is to provide a consistent state to a child process from a multithreaded parent process where locks may
be acquired and released asynchronously with respect to the fork(2) call. Each subsystem with locks that are used in a child process should
register handlers with pthread_atfork() that acquires those locks in the prepare handler and releases them in the parent handler.
RETURN VALUES
The pthread_atfork() function returns 0 on success and an error number on failure.
ERRORS
The following error code may be returned:
[ENOMEM] Insufficient memory exists to register the fork handlers.
SEE ALSO
fork(2)
STANDARDS
The pthread_atfork() function conforms to IEEE Std 1003.1c-1995 (``POSIX.1'').
HISTORY
The pthread_atfork() function first appeared in NetBSD 2.0.
CAVEATS
After calling fork(2) from a multithreaded process, it is only safe to call async-signal-safe functions until calling one of the exec(3)
functions. The pthread_*() functions are not async-signal-safe, so it is not safe to use such functions in the child handler.
BUGS
There is no way to unregister a handler registered with pthread_atfork().
BSD
February 12, 2003 BSD