I'm trying to locate all files that do not contain the string /usr but do contain the string csh within the file called /etc/passwd. Then I would like to direct this output to a file called pout.
Does anyone one have suggestions on this one?
Thanks (2 Replies)
Hi , i need a fast way to delete duplicates entrys from very huge files ( >2 Gbs ) , these files are in plain text.
I tried all the usual methods ( awk / sort /uniq / sed /grep .. ) but it always ended with the same result (memory core dump)
In using HP-UX large servers.
Any advice will... (8 Replies)
Hi, all:
I've got two folders, say, "folder1" and "folder2".
Under each, there are thousands of files.
It's quite obvious that there are some files missing in each. I just would like to find them. I believe this can be done by "diff" command.
However, if I change the above question a... (1 Reply)
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
My question is :
-How do I locate files of specific user in specific folder.
In other words, How do I find files that belong only to "root" user, in /etc folder? (5 Replies)
I've created a test script, which is located in $HOME/bin. The script runs as expected with no issues. However, upon echo'ing the $path variable the location of my script is not located in any of the directories listed in $path. So my question is, how does shell know where the script is located... (2 Replies)
Hi All,
I am looking for a perl/awk/sed command to auto-increment the numbers line in file, P1.tcl:
run_build_model sparc_ifu_dec
run_drc
set_faults -model path_delay -atpg_effectiveness -fault_coverage
add_delay_paths P1
set_atpg -abort_limit 1000
run_atpg -ndetects 1000
I would like... (6 Replies)
Guys i need an idea for one logic..in shell scripting am struggling with a logic...So the thing is... i need to search for a word in a huge log file and i need to continue to print few more lines from that line and the consecutive line has to end when it finds the line with date..because i know... (1 Reply)
Discussion started by: Prathi
1 Replies
LEARN ABOUT OPENSOLARIS
flockfile
flockfile(3C) Standard C Library Functions flockfile(3C)NAME
flockfile, funlockfile, ftrylockfile - acquire and release stream lock
SYNOPSIS
#include <stdio.h>
void flockfile(FILE *stream);
void funlockfile(FILE *stream);
int ftrylockfile(FILE *stream);
DESCRIPTION
The flockfile() function acquires an internal lock of a stream stream. If the lock is already acquired by another thread, the thread call-
ing flockfile() is suspended until it can acquire the lock. In the case that the stream lock is available, flockfile() not only acquires
the lock, but keeps track of the number of times it is being called by the current thread. This implies that the stream lock can be
acquired more than once by the same thread.
The funlockfile() function releases the lock being held by the current thread. In the case of recursive locking, this function must be
called the same number of times flockfile() was called. After the number of funlockfile() calls is equal to the number of flockfile()
calls, the stream lock is available for other threads to acquire.
The ftrylockfile() function acquires an internal lock of a stream stream, only if that object is available. In essence ftrylockfile() is a
non-blocking version of flockfile().
RETURN VALUES
The ftrylockfile() function returns 0 on success and non-zero to indicate a lock cannot be acquired.
EXAMPLES
Example 1 A sample program of flockfile().
The following example prints everything out together, blocking other threads that might want to write to the same file between calls to
fprintf(3C):
FILE iop;
flockfile(iop);
fprintf(iop, "hello ");
fprintf(iop, "world);
fputc(iop, 'a');
funlockfile(iop);
An unlocked interface is available in case performance is an issue. For example:
flockfile(iop);
while (!feof(iop)) {
*c++ = getc_unlocked(iop);
}
funlockfile(iop);
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO Intro(3), __fsetlocking(3C), ferror(3C), fprintf(3C), getc(3C), putc(3C), stdio(3C), ungetc(3C), attributes(5), standards(5)NOTES
The interfaces on this page are as specified in IEEE Std 1003.1:2001. See standards(5).
SunOS 5.11 10 Sep 2003 flockfile(3C)