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 DEBIAN
medit
MEDIT(1) General Commands Manual MEDIT(1)NAME
medit - text editor
SYNOPSIS
medit [OPTION]... [FILES]
DESCRIPTION
medit is a text editor.
OPTIONS -n, --new-app
run new instance of medit. By default medit opens FILES (or creates a new document if none are given) in an existing instance of
application
-s, --use-session[=yes|no]
load and save session. By default medit does it when -n is not used. If this option is not given on command line then medit uses
the corresponding preferences setting.
--pid PID
use existing instance with process id PID.
--app-name NAME
use instance name NAME. If an instance with this name is already running, then it will send files given on the command line to that
instance and exit.
-e, --encoding ENCODING
use provided character encoding to open the file
-l, --line LINE
open file and position cursor on line LINE. Alternatively line number may be specified with filename, e.g. medit foo.txt:12
-r, --reload
automatically reload opened file if it was modified on disk by another program.
-w, --new-window
open file in a new window.
-t, --new-tab
open file in a new tab.
--log-file FILE
write debug output into FILE. This option is only useful on Windows.
--log-window
show debug output in a log window. This option is only useful on Windows.
--debug DOMAINS
enable debug output for DOMAINS (if medit was compiled with --enable-debug option).
--geometry WIDTHxHEIGHT
--geometry WIDTHxHEIGHT+X+Y
default window size and position.
-h, --help
show summary of options.
-v, --version
show program version.
FILES list of files to open. Filenames may include line numbers after colon, e.g. /tmp/file.txt:200. Trailing colon is ignored.
ENVIRONMENT VARIABLES
MEDIT_PID
if set, it is used as --pid argument. When medit spawns a process (e.g. a DVI viewer) it sets MEDIT_PID to its own process id, so
the child process may in turn simply use 'medit filename' to open a file (e.g. for inverse DVI search).
CONTACT
http://mooedit.sourceforge.net/contact.html
AUTHOR
Written and maintained by Yevgen Muntyan <emuntyan@users.sourceforge.net>
September 2010 MEDIT(1)