but again you really don't seem to understand i can't do this! some people can some can't
also i've looked at explode and can't figure it out nor do i think it's what i need :\ |
Quote:
No, I do understand, but you're missing several points. Let me be more clear: 1. PHP is one option. I only mentioned it because YOU started the thread, by bringing up PHP. I gave you the link to the resource and example on how to do it via PHP. 2. BASH script is the second option. I gave you the commands to use (sed and awk), which have ample documentation, both through man pages and thousands of examples that can be easily found through Google. 3. If you can't do it, why do you not think the solutions given to you are what you need? 4. If you can't do it HIRE SOMEONE WHO CAN OR LET SOMEONE ELSE DO IT. Google for "linux sed search replace". You will find lots of information with sample scripts that you can use. If that's too hard, again....HIRE SOMEONE. |
getting to work now will post what i have soon :)
|
right now i'm getting somewhere but i'm having trouble so i'll post what i have:
this strips the "RewriteCond %{REMOTE_ADDR}" line from my file and writes it to a new file Code:
grep -i "RewriteCond %{REMOTE_ADDR}" /home2/test.txt > /home2/list.txt this removes the "RewriteCond %{REMOTE_ADDR} (" part Code:
sed -i 's/RewriteCond %{REMOTE_ADDR} (//g' /home2/list.txt now i'm trying to use sed and the same command above to remove all the \ but i get this error: Quote:
and i'm also trying to remove )$ at the end of the file but it's not removing it or giving me an error here's the command: Code:
sed -i 's/)$//g' /home2/list.txt |
Quote:
Quote:
Code:
sed 's/\\//g' /home2/list.txt This should also work for this: Code:
sed 's/\)\$//g' /home2/list.txt You can also (if you want to), string your sed's together on one line, like this: Code:
cat <filename> | sed <whatever> | sed <whatever> | sed <whatever> > output.file |
if i don't put a -i in this command it just outputs on the screen and not to a file
Code:
sed 's/\\//g' /home2/list.txt Quote:
|
right i've almost done it with this so far:
Code:
grep -i "RewriteCond %{REMOTE_ADDR}" /home2/test.txt > /home2/list.txt |
nm i've done it with the following:
Code:
grep -i "RewriteCond %{REMOTE_ADDR}" /home2/test.txt > /home2/list.txt |
Quote:
Code:
sed 's/\\)\$//g' /home2/list.txt |
Quote:
http://www.linuxquestions.org/questi...54#post3423054 |
seems like i forgot i was wanting this to be a html page so i edited it to display properly:
Code:
grep -i "RewriteCond %{REMOTE_ADDR}" /home2/.htaccess > /home2/test.html i've searched google but i'm not getting anything other then weird links |
Quote:
Code:
echo "Beginning line of my report..." > output.file There's lots of different ways to do it, that's VERY quick, and VERY dirty. Quote:
|
wow that's an amazing trick and i had not idea about the double > thank you very much
|
All times are GMT -5. The time now is 06:14 PM. |