Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Binary line being inserted while truncating a file Post 302353272 by akshay61286 on Tuesday 15th of September 2009 03:36:37 AM
Old 09-15-2009
Quote:
Originally Posted by pludi
You've got to give us some more information on how you truncate the file, what kind of link you use, and what and how another application might write into that file, because I can't yet reproduce that behaviour
Hi,

Following are the steps which we follow :-
1) a log file is generated through the redirection of Jboss' run.sh
Code:
nohup $JBOSS_HOME/bin/run.sh -c Instance_Name >  abc.log &

2)the above log file abc.log is then linked via :-
Code:
ln abc.log $JBOSS_HOME/server/deploy/jboss-web/ROOT/abc.txt

3) Every night a copy of the log file in ROOT is made and the original one is truncated :-
Code:
>abc.txt

After step 3, a new binary line is found as the first line of the truncated file

So a few points :-
1) the log file is being written by JBoss
2) linking is not via "-s"

Hope i cleared some doubts
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

truncating leading zeros of a column in a file

Hi I have a file in which I have 5 columns which are delimited by “|” as shown ABC|12|YAK|METRIC|000000019.5 XYZ|10|ABX|META|000000002.5 Now my requirement is to take the last column trim the leading zero's for that column values and write back to the same file in the same... (7 Replies)
Discussion started by: nvuradi
7 Replies

2. Shell Programming and Scripting

Truncating FILE data BASED ON A PATTERN

HI I HAVE A PROBLEM,MY SOURCE FILE IS OF PATTERN S1,E-Certified,29,29,2.7,Certified,4,3,2.7,,0,0,0 S2,Certified,4,3,2.7,,0,0,0,,0 S3,E-Certified,29,29,2.7,,0,0,0 S4,,0,0,0,,0,0,0,,0,0,0,,0,0,0 AND THE EXPECTED OUTPUT IS S1,E-Certified,29,29,2.7 S1,Certified,4,3,2.7... (1 Reply)
Discussion started by: pkumar3
1 Replies

3. Shell Programming and Scripting

Removing inserted newlines from a fileld of fixed width file.

Hi champs! I have a fixed width file in which the records appear like this 11111 <fixed spaces such as 6> description for 11111 <fixed spaces such as 6> some more field to the record of 11111 22222 <fixed spaces such as 6> description for 22222 <fixed spaces such as 6> some more field to the... (8 Replies)
Discussion started by: enigma_1
8 Replies

4. UNIX for Dummies Questions & Answers

Truncating file based on date

Hi, I need to truncate a file based on date.Suppose i have a log file which is getting updated every date,i need to keep 7 days worth of data(like sysdate-7) and rest i want to truncate it.Can some help me? (5 Replies)
Discussion started by: Param0073
5 Replies

5. Shell Programming and Scripting

sed truncating last line if EOF is not with newline

sed 's|^xyz.abc *= *.*|xyz.abc=60|' /test/myFile.properties > /test/myFile.properties1 myFile.properties has the last line as xyz.abc=23 does not end with newline. When I run this command the last line is truncated if there is no newline character at EOF. Looking for an alternative here. (1 Reply)
Discussion started by: sunn_hps
1 Replies

6. Shell Programming and Scripting

script to detect a file from inserted usb and puts into a Variable

There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone: /media/F6BA-0AF5/folder/A.log I want to put that into a variable to be manipulated.... (3 Replies)
Discussion started by: tobenguyen
3 Replies

7. Shell Programming and Scripting

How to avoid the truncating of multiple spaces into a single space while reading a line from a file?

consider the small piece of code while read line do echo $line done < example content of example file sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr the output is like sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr the... (4 Replies)
Discussion started by: Kesavan
4 Replies

8. Shell Programming and Scripting

Truncating a mail file

Hi, I have a Unix mail file that I need to truncate, based on the date of the messages. For those not familiar with the format, it is a single file for each user, with the first line of the mail message looking like the following: From user@sitename.com Thu Apr 21 05:40:33 2011 Each... (3 Replies)
Discussion started by: joed
3 Replies

9. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

10. Shell Programming and Scripting

How to add new line after every data inserted to file?

Hi all, I need help for solve my problem. my problem is like this.. i want to add many word to file. but after I add 1 word, the second word should be in the under of the first word. i have tried but the result is like this word1word2word3 i want the result to be like this word1 word2... (5 Replies)
Discussion started by: weslyarfan
5 Replies
umodem(1)						      General Commands Manual							 umodem(1)

NAME
umodem - XMODEM-protocol file transfer program SYNOPSIS
[options] files ... DESCRIPTION
is a file transfer program that incorporates the well-known XMODEM protocol used on CP/M systems and on the HP 110 portable computer. Options recognizes the following options and command-line arguments: (one) Employ TERM II FTP 1. Enable TERM FTP 3 (CP/M UG). Enable 7-bit transfer mask. Turn on ARPA Net flag. Enter command mode. Do not delete before starting. (ell) Turn on entry logging. Allow overwriting of files. Print all messages. Receive file. Specify for text, or for binary. Send file. Specify for text, or for binary. Display file status only. files Name of file or files to be transferred. WARNINGS
When a binary file is transferred, the target file may have some extra bytes added at the end. This is due to the limitation of the under- lying protocol. EXAMPLES
Receive a text file: Receive a binary file: Send a text file: Send a binary file: AUTHOR
is in the public domain. SEE ALSO
cu(1), kermit(1), uucp(1). umodem(1)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy