10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Trying to use sed to insert the contents of a file into the end of each line in another file
file1
This is a line
Here is another line
This is yet another line
Here is a fourth line
file2
TEXT
desired output
This is a line TEXT
Here is another line TEXT
This is yet another... (6 Replies)
Discussion started by: jimmyf
6 Replies
2. AIX
Dears,
I am trying to write a script to read the lines from a file in AIX Server.
Below are the contents of the file. To explain, first part before = is path and second part is number.
i am trying to write the script to print the path and count where count>100. any help must be appreciated... (3 Replies)
Discussion started by: sibbala
3 Replies
3. Shell Programming and Scripting
Use sed to print first n lines and last n lines of an output.
For example: n=10
Can it be done?
Thanks. (7 Replies)
Discussion started by: carloszhang
7 Replies
4. Shell Programming and Scripting
I want to do something like sed -n '/PATTERN/,+10p' and get the ten lines following PATTERN. However, this throws an "expected context address" with the sed that comes with OSX Lion. If that + is a GNUism, can I do this, or do I have to find another tool? (2 Replies)
Discussion started by: jnojr
2 Replies
5. Shell Programming and Scripting
I am trying to extract a table of data (mysql query output) from a log file. I need to print everything below the header and not past the end of the table. I have spent many hours searching with little progress. I am matching the regexp +-\{99\} with no problem. I just can't figure out how to print... (5 Replies)
Discussion started by: godfreydanials
5 Replies
6. UNIX for Dummies Questions & Answers
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Discussion started by: victor.s
3 Replies
7. Shell Programming and Scripting
I am trying to print those line which has no # in the begining of the line.
The sed I used for this purpose as shown below is not giving the required output.
echo 'PDE 5600' | sed -n 's/^\!#/&/p'
Where lies the problem:confused: (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies
8. Shell Programming and Scripting
This i will print the second line of a file
sed -n '2p' test2
The use of a variable is impossible here.
a=1
while ; do
line=`sed -n '$a p' test2`
# do some things here with the line variable
a=`expr $a + 1`
done
But the uotput of sed command is 'p'..... What can i do to use a variable... (2 Replies)
Discussion started by: hakermania
2 Replies
9. Solaris
Hi guys.
I need a sed command to print like 10 lines after a regular expression is found in the log.
Can anyone help me out.
Thanks
---------- Post updated at 10:52 AM ---------- Previous update was at 10:34 AM ----------
never mind.
I just did the search bewteen two expressions. (1 Reply)
Discussion started by: jamie_collins
1 Replies
10. Shell Programming and Scripting
I must admit I am relativly new to sed, and I am trying to make a simple sed query to search log files and return multiple variables from multiple logs. So far I have had success, but one problem remains:
Alot of lines in the log files wrap onto multiple lines and are not being returned as... (2 Replies)
Discussion started by: demanche
2 Replies