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
Hi ,
I have a huge file with following records and I want to replace the last comma with ',NULL'. I try using SED but could not create a correct script .
In my opinion I need a script which can convert ,/n with ,NULL/n
1,CHANGE_MEMBER,2010-12-28 00:05:00,
2,CHANGE_MEMBER,2012-09-02... (8 Replies)
Discussion started by: Ajaypal
8 Replies
3. Shell Programming and Scripting
Removed.
My question does not make sense. and SED does see the last newline character.
But I still have a question:
How to remove the last newline character(the newline character at the end of last line) using SED?
---------- Post updated 05-01-11 at 10:51 AM ---------- Previous update was... (7 Replies)
Discussion started by: kevintse
7 Replies
4. Shell Programming and Scripting
Hi,
I use sed to insert text at beginning of a file. But sed inserts a newline after my text that I do not need. For example, I want to insert "foo" at the beginning of my file:
> cat myfile
This is first line.
> sed -i '1i\foo' myfile
> cat myfile
foo
This is first line.
... (5 Replies)
Discussion started by: tdw
5 Replies
5. Shell Programming and Scripting
Hi everyone,
I'd like to use the script validatehtml which returns either the given url is HTML strict or not, using http:// validator . w3 . org .
sh validatehtml
#!/bin/bash
wget -q http:// validator . w3 .org / check?uri=$1
cat check\?uri\=$1 | sed -n '/h2/ p' | sed 's/ */ /g' | sed... (2 Replies)
Discussion started by: azertyazerty
2 Replies
6. Shell Programming and Scripting
Input:
--------------------------
123asd 456sdasda 789a
-------------------------
output wanted:
---------------------
123asd
456sdasda
789a
----------------------
I want this by sed in simple way
please help (I know by: tr ' ' '\n' < inputfile )I want it by sed only (5 Replies)
Discussion started by: RahulJoshi
5 Replies
7. Shell Programming and Scripting
Hi
I what to add option to existing sed code to convert target file to lower case
#!/bin/ksh
SOURCE_DATA_DEST=/ora
TARGET_DATA_DEST=/home/oracle/alexz
TARGET_DB_SID=T102_test
sed -e "s/REUSE/SET/g" \
-e "s/NORESETLOGS/RESETLOGS/g" \
T102_ccf.sql > target.sql
Thanks (2 Replies)
Discussion started by: zam
2 Replies
8. Shell Programming and Scripting
Hi,
I have the following XML not well-indented code:
<hallo
>this is a line
</hallo>
So I need to remove the newline.
This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern:
sed 's/<.*$/&/'
How can I subtract the newline after my... (1 Reply)
Discussion started by: nico.ben
1 Replies
9. Shell Programming and Scripting
Hi All,
I am new to Shell scripting.. I have a task to parse the text file into csv format. more then half the things has done.
But the problem is when I use the sed command in shell script. it appends newline character at the end of the line. and so when I open the file in CSV it's format... (3 Replies)
Discussion started by: Gaurang033
3 Replies
10. UNIX for Dummies Questions & Answers
How to convert ^M appearing at end of line to unix newline?
As I have tried with ^M in 'tr' it replaced ^ to a newline.
Thanks in advance. (21 Replies)
Discussion started by: videsh77
21 Replies