10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a variable like below:
str1="10.9.11.128\n-rwxr-xr-x user1 2019-12-29 17:53 /var/branch/custom/tg.xml 286030210\n10.9.12.129\n-rwxr-xr-x user1 2019-12-29 17:53 /app/branch/custom/tg.xml 286030210\n10.9.20.130\n-rwxr-xr-x user1 2019-12-29 17:53 /web/branch/custom/tg.xml 286030210"
I... (8 Replies)
Discussion started by: mohtashims
8 Replies
2. 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
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
Hi All,
I have following piece of code in UNIX C Shell script and I want to add one more command which can add newline at the end of file only if there is no newline character exists.
foreach file (`ls $dd_PLAYCARD_EDI_IN`)
if ( -f $dd_PLAYCARD_EDI_IN/${file} ) then
cat -n... (4 Replies)
Discussion started by: jnrohit2k
4 Replies
5. Shell Programming and Scripting
How to replace null with space?
I want to make each line with 80 characters. If any line contains only 5 characters and remaining is null, then i want to make it as 80 characrets where 5 is original characters and remaining 75 characters will be null..
NULL can come in between the line,... (3 Replies)
Discussion started by: Amit.Sagpariya
3 Replies
6. Shell Programming and Scripting
Hi Guyz,
I have an XML message in following format:
I want my contents to be formatted in following order:
i.e. I want a newline after every XML tag end.
How to do this?
Thnx in advance. (5 Replies)
Discussion started by: DTechBuddy
5 Replies
7. 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
8. Shell Programming and Scripting
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Discussion started by: amio
2 Replies
9. 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
10. UNIX for Advanced & Expert Users
Hi,
I have this file which has some octal NULL characters (\000). I need to replace these characters with an ASCII NULL.
I've tried using Perl, the UNIX tr command..
History of this
I received a COBOL generated file, ran the od command to convert to a xxx byte per record file.
Now,... (3 Replies)
Discussion started by: uchachra
3 Replies