An alternate may be to open the file with tail and keep it open.
What is your overall aim for this process? You might be able to:-
I think that the < <(command) is a bash construct rather than sh or ksh so it depends if you have that or even if this is appropriate. This process will not end, but continue reading the log file when new records are written, so it's near-time (strictly not quite real-time)
Beware that the log file will remain open, so if you rotate your log files, you might need to use tail -F $logfile instead to open the replacement file.
Can you tell us what the point of this code is to be? There may be a simpler way that I'm not thinking of. It would be useful to know the OS version (output from uname -a) and shell that you are using.
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
#!/usr/bin/ksh
exec 0<property
while read newReceiveDir
do
if
then
sed -e 's//home/joshua/bodi/data/receive/{$newReceiveDir:25}/g/' mp_validate.sh >| mp_validate.sh
elif
then
sed -e 's//home/joshua/bodi/data/temp/{$newReceiveDir:22}/g/' mp_validate.sh >| mp_validate.sh ... (1 Reply)
In a file a pattern is occured many times randomly. Even it may appear more then once in the same line too. How i can get the number of times that pattern appeared in the file? let the file name is abc.txt and the pattern is "xyz".
I used the following code:
grep -ic "xyz" abc.txt
but it is... (3 Replies)
I need a script for...
how to find a position of column data and print some string in the next line and same position
position should find based on *HEADER8* in text
for ex: ord123 abs 123 987HEADER89 test234
ord124 abc 124 987HEADER88 test235
... (1 Reply)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi,
I need to search a file for a pattern,replace some other word and write a word at its 72nd position.
For example,
My name is Mano.Im learning Unix.
I want to search the file in all lines containing the word "Mano".In that matched line,replace the word "Unix" with "Java".And... (5 Replies)
I need to check 1 log file, which is logging:
2014-08-18T09:10:39+02:00 user: XXXXX START FEATURE
2014-08-18T09:10:39+02:00 user: XXXXX FINISH FEATURE
I first need to check that the START FEATURE starts and finish on the same time/date for the same user, which is different each time START... (2 Replies)
Hi,
I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
hi ,
i have a file test.dat which contains following data.
test.dat
XY|abc@xyz.com
XY|abc@xyz.com
ST|abc@xyz.com
ST|abc@xyz.com
ST|XYZ@abc.com
FK|abc@xyz.com
FK|STG@xyz.com
FK|abc@xyz.com
FK|FKG@xyz.com
i want to know the count of XY,ST,FK.
i.e XY = 2 , ST = 3 , FK = 4
I am... (4 Replies)
Discussion started by: itzkashi
4 Replies
LEARN ABOUT HPUX
getdtablesize
getdtablesize(2) System Calls Manual getdtablesize(2)NAME
getdtablesize() - get the size of the per-process file descriptor table
SYNOPSIS DESCRIPTION
The function returns the maximum number of file descriptors that can currently be stored in a process' file descriptor table. This maximum
number is also known as the soft limit for open files, and can be adjusted up to the hard limit by calling The entries in the descriptor
table are numbered with small integers starting at 0 (zero).
The function returns the total number of file descriptors that a process can have open simultaneously. Each process is limited to a cur-
rent maximum (soft limit) and a fixed upper bound (hard limit) of open file descriptors. This limit is at least 32. The system-defined
limits are configurable. See the descriptions of the and kernel parameters in maxfiles_lim(5) and maxfiles(5), respectively, for informa-
tion about changing the system-defined, per-process limit on open file descriptors.
RETURN VALUES
The function returns the size of the descriptor table (soft limit), and is always successful.
SEE ALSO close(2), getrlimit(2), open(2), select(2), setrlimit(2), sysconf(2), maxfiles(5), maxfiles_lim(5).
STANDARDS CONFORMANCE getdtablesize(2)