10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Discussion started by: aku
4 Replies
2. Shell Programming and Scripting
hi,
i have two files.
file1.sh
echo "unix"
echo "linux"
file2.sh
echo "unix linux forums"
now the output i need is
$./file2.sh
unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies
3. UNIX for Dummies Questions & Answers
hay i need to display middle line:
1
2
3
4
5
how can i display 3-4? (6 Replies)
Discussion started by: margan_ron
6 Replies
4. Shell Programming and Scripting
Hi
I have a data file 'File2' consisting of 105670 lines. I want to copy and paste 17928 lines from 'File1' to 'File2' but I want to place it in between lines 21 and 17950 of 'File2'. How do I do it in awk?
For example-
File A has 5 lines
X
Y
1 2 3
4 5 6
7 8 9
and File B has
A
b... (1 Reply)
Discussion started by: ananyob
1 Replies
5. Shell Programming and Scripting
I have a file where in I need to add gctunit1/gtdivcompebb1/ after the = sign
for example:
gtfix31/gctunit_gtdivcompebb1/csclkswcompbypassstepgnnnh = gctunit1/gtdivcompebb1/csclkswcompbypassstepgnnnh (3 Replies)
Discussion started by: pitagi
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I want to write a script that takes a file and a string as params and adds the string to the middle line of the file. Also, I want to output the results back to the original file passed without using temp files.
I am very much new to UNIX so this is all a little like black magic to me at... (15 Replies)
Discussion started by: Chiefos
15 Replies
7. Shell Programming and Scripting
I've got a configuration file that is filled with xml text statements for example:
<...../>
<...../>
<...../>
<data id="java-options" value="-server -Djava.security.policy..../>
<...../>
<...../>
<...../>
I want to write a korn shell script that will go to this specific line and add a... (2 Replies)
Discussion started by: progkcp
2 Replies
8. Shell Programming and Scripting
Can anyone help me pls? I want to add a text into the middle of file.
I've writtenthe following script
text to add="$1"
file="$2"
lines=$(wc -l $2)
half_lines=$(expr $lines / 2)
head -$half_lines $2 > temp
echo "text to add" >> temp
((half_lines=$half_lines + 1))
tail -$half_lines $2... (6 Replies)
Discussion started by: relle
6 Replies
9. Shell Programming and Scripting
i want to add a string in a very top of a file without using VI or SED or AWK
this is what ive done:
(echo '0a'; echo 'LINE OF TEXT'; echo '.'; echo 'wq') | ed -s myfile
to add astrng right in the middle i could have count the lines of the file and just chenge the address.
... (6 Replies)
Discussion started by: ciroredz
6 Replies
10. Shell Programming and Scripting
Hi,
I have tried many times to add the string into the first line of the file or the middle of the file but could not find the solution.
I first tried by
$echo "paki" >> file
This code only append paki string at the end of file "file" but how can i add this "paki" into the first line or... (5 Replies)
Discussion started by: ali hussain
5 Replies