10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I'm appending a line before a pattern and after another pattern(;) but omitting the first pattern - same as if comes duplicates before the second pattern.
Also, I'm adding a word before the first pattern -
Here is my file
select blah blah
hello
select blah blah
;
select... (6 Replies)
Discussion started by: Mannu2525
6 Replies
2. UNIX for Dummies Questions & Answers
I want to append matched output and cat the results into an variable. but I've been running into problems. sed is printing result on to screen instead of appending the output to $CAPTURE. I'm stumped...how should i fix this?
contents of $TEST
10.0.0.1
10.0.0.2
10.0.0.3
10.0.0.4
expected... (5 Replies)
Discussion started by: jazzaddict
5 Replies
3. Shell Programming and Scripting
Source File:
abcdefghijklmnop01qrstuvwxyz
abcdefghijklmnop02qrstuvwxyz
abcdefghijklmnop03qrstuvwxyz
abcdefghijklmnop04qrstuvwxyz
abcdefghijklmnop05qrstuvwxyz
Whatever characters are in 17-18 on each line of the file, it should be concatenated to the same line at the character number... (6 Replies)
Discussion started by: tamahomekarasu
6 Replies
4. Shell Programming and Scripting
I know this has been asked before but I just can't parse the syntax as explained. I have a set of files that has user information spread out over two lines that I wish to merge into one:
User1NameLast User1NameFirst User1Address
E-Mail:User1email
User2NameLast User2NameFirst User2Address... (11 Replies)
Discussion started by: walkerwheeler
11 Replies
5. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
6. UNIX for Dummies Questions & Answers
I'm using the sed command to pull a line from a file and place it into another file:
sed -n '1p' students >tmp
this pulls the first line, I want to change the 1 to a variable which will be a counter to go through the rest of the lines but can't get it. I've tried:
sed -n '$cp students... (3 Replies)
Discussion started by: atchleykl
3 Replies
7. Shell Programming and Scripting
Hi all,
I have to append every alternate line after its previous line. For example if my file has following contents
line 1: unix is an OS
line 2: it is open source
line 3: it supports shell programming
line 4: we can write shell scripts
Required output should be
line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
4 Replies
8. UNIX for Dummies Questions & Answers
Have another question that has been eluding me all day.
I have data file I'm trying to reformat so that each line is appended with an ID code, but the ID code needs to update as it searches through the file.
I.e.
----Begin Original Datafile-----
Condition = XXX
Header Line 1
Header... (1 Reply)
Discussion started by: selkirk
1 Replies
9. Shell Programming and Scripting
Hi folks,
Our application installation uses "sed" command to append string after specific line or after line number.
Both cases work perfect on Linux but fail on Solaris.
The OS versions are Solaris 9 and Linux Red Hat AS 3.
i.g:
Linux:
-----
file foo.txt
aaa
bbb
ccc
ddd
root#... (4 Replies)
Discussion started by: nir_s
4 Replies
10. Shell Programming and Scripting
Hi folks,
I need to append line or bulk of lines into a file.
For example,I have the following section in opmn.xml file:
<process-type id="OC4J_RTEadmin_NIR" module-id="OC4J">
<module-data>
<category id="start-parameters">
<data... (28 Replies)
Discussion started by: nir_s
28 Replies