![]() |
(*)nix gurus - I need help with something...
What can I do on the command line to achieve this:
Code:
<? include("file"); ?> So say I have: domain.com/teens domain.com/latinas domain.com/lesbians And each directory (teens, latinas and lesbians) has a file called index.php in it and I want that include code to be added to the TOP of (prepended to) the file. Anyone know of some command line code or a bash script that can achive this? |
Code:
for i in $(find ./ -name index.php); do cat $i |sed -e "s#<html>#<html><? include \(\"file\"\); ?>#" > $-new && mv $i-new $i;done i know it can be done with first line crap :P awk,sed,vi you name it :D too tired to think |
*not tested*
put your code in a file code.txt then: script.sh Code:
#!/bin/sh BACKUP first :) |
Don't forget: you can always run php on the command line too :) Unless you have it installed as a DSO module in apache, but in that case you can install the stand-alone executable as well - what ever version you need.
|
Darksouls appears to be correct.. will make a fake spot on the server and try it.
|
All times are GMT -7. The time now is 12:40 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123