10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I want ot print a header with new line in the end. I am using echo
like echo "this is header"
I want output like
This is header
$
I tried -e also but it's not working. echo - e
Can anyone help please? (6 Replies)
Discussion started by: dsa
6 Replies
2. Shell Programming and Scripting
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
19 Replies
3. Shell Programming and Scripting
In my script I am using sed to insert a line.
Suppose I have a variable called ck_size=5 and a temporary file called tmp
I want to add a certain line in the tmp file .Please see the below command
sed -i '2a\maitee is $ck_size' /dun/homes/lrsprod/tmp
I want in 2 line of tmp file... (7 Replies)
Discussion started by: maitree
7 Replies
4. Shell Programming and Scripting
Hello,
I am new to this forum. I have a question in Unix shell scripting. Here is my requirement
I have 1000 files and I need to insert a header with one line at the top of
each of the 1000 files. Please let me know if you have any solution for this
Thanks in advance.
Raj (4 Replies)
Discussion started by: trajashekar
4 Replies
5. Shell Programming and Scripting
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Discussion started by: appu2176
4 Replies
6. Shell Programming and Scripting
I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well.
Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line.
File:
red blue green ABC.txt@ABC END
black... (1 Reply)
Discussion started by: ngupta
1 Replies
7. UNIX for Advanced & Expert Users
Hi
Is there any command where we can insert a line "2|||" before every line starting with "3|"
my input is as follows
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
3|79.58|||GBP||
1|ETG|12345
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
1|ETG|12345
3|88.51|||GBP||
desired output... (10 Replies)
Discussion started by: laxmi131
10 Replies
8. Shell Programming and Scripting
I have a file where each line starts with a "update" statement. I want to insert a new line, after each line, with the words "go" in the new line. Can someone help me out with this? (1 Reply)
Discussion started by: ssmallya
1 Replies
9. Shell Programming and Scripting
I'm sure you guys have answered this elsewhere but I can't seem to find where so here goes.
#!/bin/bash
n=120
a=$(sed '120q;d' energy.xvg)
while ;do
a=$(sed $n'q;d' energy.xvg)
echo "$a \n" > newfile
n=$(($n+100))
done
exit 0
that script should read the file energy.xvg, start at... (1 Reply)
Discussion started by: gelitini
1 Replies
10. UNIX for Dummies Questions & Answers
guys can anyone tel me how to insert a line in a file(bash) using line number
i wanna insert the line using LINE NUMBER...i know for inserting above or below a perticular line we can use sed a\ or i\....
thanks in advance.... (7 Replies)
Discussion started by: anj
7 Replies