Tagged Questions
4
votes
2answers
259 views
Passing parsed output of sed to find (in this direction)
Well, I think you can find dozens of questions on this platform how to pipe find output to sed, but I haven't found anything for the reverse direction so far. What I want to do is modify my input, and ...
5
votes
5answers
354 views
resolve all ip addresses in command output using standard command line tools
I have several log files that contain a bunch of ip addresses. I would love to be able to pipe the data through a program that would match and resolve ip addresses.
I.E.
cat /var/log/somelogfile | ...
1
vote
2answers
1k views
grep piping into sed, replacing inline; but I want sed to print the filename and changed line. Is it possible?
Here's my command (break intentional):
grep FOO "/Users/gjtorikian/blah" -l | xargs sed -i '' '/FOO/{s/FOO/BAR/g; w /dev/stdout
}'
At the high-level: grep for FOO in the blah directory; pipe in ...
5
votes
1answer
132 views
Confusion about sed and '>'
The following command works fine:
sed s/input/raw_input/ p.py >p2.py && mv p2.py p.py
However, the following command turns p.py into an empty file:
sed s/input/raw_input/ p.py >p.py
...
4
votes
3answers
306 views
Why does sed act differently depending on the output file?
If I run:
cat messages.txt | sed -e 's/a/a/g' > messages.txt
on one large file (2500+ lines) I find that the resulting file will only have about 900 lines after the command in cygwin and will ...