Hi Folks !!!!!!!!!!!!!!!!!!!
My Requirement is.............
i have a input file:
501,501.chan
502,502.anand
503,503.biji
504,504.raja
505,505.chan
506,506.anand
507,507.chan
and my o/p should be
chan->3
i.e. the word which occurs maximum number of times in a file should be... (5 Replies)
Hi all,
I have a file with lines written somewhat like this.
aaaa
ccc
aa
linux
browse = no
xssxw
cdcedc
dcsdcd
csdw
police
dwed
dwd
browse = no
cdecec (2 Replies)
File having data in following format :
file name : file.txt
--------------------
111111;name1
222222;name2
333333;name3
I want to read this file so that I can split these into two paramaters i.e. 111111 & name1 into two different variables(say value1 & value2).
i.e val1=11111 &... (2 Replies)
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)
hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this:
I have in my response lines like:
<div class="sender">mimi020</div>
<some html code.....>... (3 Replies)
Hi All,
I have a XML file which is looks like as below. <<please see the attachment >>
<?xml version="1.0" encoding="UTF-8"?>
<esites>
<esite>
<name>XXX.com</name>
<storeId>10001</storeId>
<module>
... (4 Replies)
example:
i have the following text file...
i am very tired.
i am busy
i am hungry
i have to find the number of occurence of a particular word 'am' from the text file.. can any one give the shell script for it (34 Replies)
Discussion started by: sheela
34 Replies
LEARN ABOUT SUNOS
ftrylockfile
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.10 10 Sep 2003 flockfile(3C)