Hello Everyone! Of course I am rather new to these forums, but I have been browsing the forums for awhile, always has a lot of useful information
This time however, I can not find the information I need, well, not completely. So here is the problem, I am a linux admin (dealing mostly with security/abuse), and a customer has the code below, injected into a large number of their files.
I was attempting to do this with a simple perl one liner, but then found out I would have to do escapes for both the shell and perl to be able to make it work.
Of course I was testing first with only doing it on one file. Trying to use the regex to match would either give an error regarding a less than sign, or newline, or if it was successful it would remove another portion of the file at the bottom, which I did not want.
I am trying to find a better way to do this of course, and so I thought maybe remove any text inserted after the closing html tag, but that is not always the case. So the best bet seems to match the text with a regex and remove it. Any help doing so would be much much much appreciated!
Hi Everybody! First post! Totally noobie.
I'm using the terminal to read a poorly formatted book.
The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this.
I was hoping to use grep -v " -- "... (5 Replies)
Hi,
I want to remove the spaces from all the lines matching a particular pattern from my file. For instance in file abc.txt I have following data.
Header,This is the header
111,this is 1st record
222, this is 2nd record
333, this is 3rd record
Footer,3 records found
Footer,111222333 ... (5 Replies)
I wrote a Bash script which checks to see if a text string exists on a web page and then sends me an email if it does (or does not e.g. "Out of stock"). I run it from my crontab, it's quite handy from time to time and I've been using it for a few years now.
The script uses wget to download an... (6 Replies)
I am on ubuntu 11.10 using bash scripts
I want to remove all files matching a string pattern and I am using the following code
find . -name "*$pattern*" -exec rm -f {} \;I have encountered a problem when $pattern is empty. In this case all my files in my current directory were deleted. This... (3 Replies)
Hi all
I have a file with records starting with "Page" has a first column.
some of the records have some other junk characters has first column.
so pls help me to remove rows which is not having "Page" has a first column.
Thanks,
Baski (2 Replies)
I have a file1 that looks like this:
File 1
a b
b c
c e
d e
and a file 2 that looks like this:
File 2
b
c
e
e
Note that file 2 is the right hand column from file1. I want to remove any lines from file1 that begin with the column in file2. In this case the desired output... (6 Replies)
Hello all,
I am in need of assistance in creating a script that will remove a specified block of text from multiple .htaccess files. (roughly 1000 files)
I am attempting to help with a project to clean up a linux server that has a series of unwanted url rewrites in place, as well as some... (4 Replies)
I have the following:
HH:MM:SS
I want to use either % or # sign to remove :SS can somebody please provide me an example. I know how to do this in awk, but awk is too much
overhead for something this simple since I will be doing this in a loop a lot of times.
Thanks in advance to all... (2 Replies)
Hi,
I have a log file which might have certain paragraphs.
Switch not possible Error code 1234
Process number 678
Log not available Error code 567
Process number 874
.....
......
......
Now I create an exception file like this.
cat text.exp
Error code 1234
Process number 874 (7 Replies)