10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
I have maybe a simple Problem - but I do not know to handle it.
All what I want, is to write a line to file without a newline at the end. It works with "echo -n" for all lines, but not for the last one. At the end of the file is always a "0a" (hex)
My small script:
... (10 Replies)
Discussion started by: API
10 Replies
2. Programming
Hello, I am writing a program which runs with root privileges, and it creates a child with lowered privileges and has to redirect it's stdout and stderr to a file and then run bash.
The problem is, whenever I read this file, I want to see all of the current output, even when the program is still... (10 Replies)
Discussion started by: madd-games
10 Replies
3. Shell Programming and Scripting
Hi Gurus,
Need help. I'm a beginner in Unix. I have a requirement, need to add or append newline (\n) character in file.
Sample Data:
1|Main|Test|~#
2|Main|Hello|~#
3|Main|Unix|~#
4|Main|File|~#Output:
1|Main|Test|~#
2|Main|Hello|~#
3|Main|Unix|~#
4|Main|File|~#\n -- append only... (13 Replies)
Discussion started by: Gouri Solleti
13 Replies
4. Shell Programming and Scripting
My source file is pipe delimeted file with 53 fields.In 33 rd column i am getting mutlple new line characters,dule to that record is breaking into multiple records.
Note : here record delimter also \n
sample Source file with 6 fields :
1234|abc| \nabcd \n bvd \n cde \n |678|890|900\n
... (6 Replies)
Discussion started by: lakshmi001
6 Replies
5. Shell Programming and Scripting
Hello!
I am able to do this in bash, using:
echo -ne HELLO > file.txt
and then, 'HELLO' is written into file.txt without the newline character to be added in the end of the file.
How is this possible to be done using sh instead of bash?
If I try something similar is SH, then inside... (3 Replies)
Discussion started by: hakermania
3 Replies
6. Shell Programming and Scripting
Hi All,
I have file with only one record,always be only one record. as like below.
if that line contains newline end of the line..no need to add, if not just add the new line character.
END OF FILE. ROW COUNT: 7
Please help me..
Thanks, (9 Replies)
Discussion started by: bmk
9 Replies
7. UNIX for Dummies Questions & Answers
Hi,
i have a file where the end-of-file might be at the end of of a valid text line or on a new line
case a)
p q r
s t u <eof>
case b)
p q r
s t u
<eof>
case c)
p q r
s t u
<no data, only carriage return>
<eof>
I have a requirement where <eof> line should not be read if it's... (3 Replies)
Discussion started by: ysrini
3 Replies
8. Shell Programming and Scripting
Hi,
I have a .txt file which has a tilde(~) in it.
All that I want is to break into a newline whenever there is an occurence of '~'.
I have tried SED to do that but I could not succeed.
I would appreciate if I can get a shell script(ksh) for this problem real quick.
Thanks in advance.
... (5 Replies)
Discussion started by: ntekupal
5 Replies
9. Shell Programming and Scripting
Hey there - a bit of background on what I'm trying to accomplish, first off. I am trying to load the data from a pipe delimited file into a database. The loading tool that I use cannot handle embedded newline characters within a field, so I need to scrub them out.
Solutions that I have tried... (7 Replies)
Discussion started by: bbetteridge
7 Replies
10. Shell Programming and Scripting
Hi All,
Is there any way to append a newline character at the end of a file(coma-separated file), through shell script?
I need to check whether newline character exists at the end of a file, if it does not then append it.
Regards,
Krishna (1 Reply)
Discussion started by: KrishnaSaran
1 Replies