10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place.
What I need
The following command is placed at the prompt:
TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies
2. Shell Programming and Scripting
I want to put a particular text, say, the hash '#' before each of the first n lines of a file.
How can I do that? (4 Replies)
Discussion started by: hbar
4 Replies
3. Shell Programming and Scripting
Dear All,
Suppose I have a file:
1 1 1 1
2 2 2 2
3 3 3 3I want to insert new line under each old line so that the file would become:
1 1 1 1
1 1 1 1
2 2 2 2
2 2 2 2
3 3 3 3
3 3 3 3How can this be accomplished using awk (or sed)? (5 Replies)
Discussion started by: littlewenwen
5 Replies
4. Shell Programming and Scripting
Hello people,
I am trying with sed to insert some text at the beginning of each odd line of a file but no luck. Can you please help. Awk is also suitable but I am not very familiar with it.
Thank you in advance for any help. (7 Replies)
Discussion started by: drbiloukos
7 Replies
5. Shell Programming and Scripting
how can i insert a string sush as "###" instead of blank lines in a file?
i try this code but it doesn't work!
awk 'NF<1 {$1=="###" ; print$0}' in_file > out_file (13 Replies)
Discussion started by: oreka18
13 Replies
6. Shell Programming and Scripting
I have done this sed command to insert one line after a specific string is found:
sed '/patternstring/ a\
new line string' file1
But how do I insert two lines? This is not possible:
sed '/patternstring/ a\
new line string \a
new line string 2' file1 (2 Replies)
Discussion started by: locoroco
2 Replies
7. Linux
hi all,
i am using a Ubuntu work station. i have following piece of code that works ok. But i cant figure out a way to insert a string call $Name into the title of the window i am opening. As you can see, i tried two different ways without a success. Can someone please help me out here? :(
... (3 Replies)
Discussion started by: usustarr
3 Replies
8. Shell Programming and Scripting
Hello...I'm here again.
This is the situation
I want check if exist text between two lines:
Example:
interface
description --text to verify
ip adress
if not exists text between 'interface' and 'ip address' i want insert the word 'no description'
interface
no description --if not... (4 Replies)
Discussion started by: bobbasystem
4 Replies
9. Shell Programming and Scripting
Hi,
New problem, or challenge as they prefer in the US.
I need to insert some lines in a file before certain other lines.
To make it more clear:
Original file:
aaaa
bbbbb
ccccc
ddddd
bbbbb
fffff
ggggg
Now I want to insert the line "NEW_NEW_NEW" when I match "fffff", but I want... (7 Replies)
Discussion started by: ejdv
7 Replies
10. Shell Programming and Scripting
I'm working with a file like:
somestuff
somemorestuff
...
someadditionalstuff
STARTTAG
ENDTAG
someotherstuff
somecoolstuff
...
somefinalstuffI've got some text (either in a file or piped) to put between STARTTAG and ENDTAG. I was thinking something like grepping for the line number of... (2 Replies)
Discussion started by: BMDan
2 Replies