„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
for file in `find . -type f -name "*.php"`; do sed -r
-e "s@([[:space:]]*global[[:space:]]*)HTTP(_[A-Z]*)_FILES|VARS,[[:space:]]*@1@g"
-e "s@([[:space:]]*global[[:space:]]*.*),[[:space:]]*HTTP(_[A-Z]*)_FILES|VARS@1@g"
-e "s@([[:space:]]*global[[:space:]]*.*)HTTP(_[A-Z]*)_FILES|VARS@1@g"
-e "s@HTTP(_[A-Z]*)_FILES@_FILES@g"
-e "s@HTTP(_[A-Z]*)_VARS@1@g"
-i ${file};
done
for file in `find . -type f -name "*.php"`; do
sed 's/(^[[:space:]]*global[[:space:]].*)[,][[:space:]]*$HTTP_[A-Z]*_(VARS|FILES)/1/g' -i ${file} &&
sed 's/(^[[:space:]]*global[[:space:]].*)$HTTP_[A-Z]*_(VARS|FILES)([,][[:space:]]*)*/1/g' -i ${file} &&
sed 's/(^[[:space:]]*global[[:space:]].*)[,][[:space:]]*[;]$/1;/g' -i ${file} &&
sed '/^[[:space:]]*global[[:space:]]([[:space:]]*[,]*)*[;]$/d' -i ${file} &&
sed 's/HTTP(_[A-Z]*)_VARS/1/g' -i ${file} &&
sed 's/HTTP_[A-Z]*_FILES/_FILES/g' -i ${file};
done
Deine Variante werde ich heute/morgen testen, danke.
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.