Work:Dos2Unix Stuff

From Zoelife4U Wiki
Jump to: navigation, search

Command Line

PHP

<?php
// This code is licensed under the GPL Version 2.0 only
// Make sure you name the file with the .php extension
// or one that is run as php.
// This script now allows it"s file name to be anything,
// so long as it is run through the php parser.
// This is Version 1.0
 
echo "<!-- This code is licensed under the GPL Version 2.0 only -->\n";
 
	echo "\nRemoving DOS Line Endings.";
	echo "\nThere is no file checking in here yet, do NOT execute this on binary files. ";
        echo "\nZend Encoded, Ioncube, Source Guardian, Compiled CGI files are included.";
        system ("find public_html/ -type f -name \*.pl -exec dos2unix {} \;");
        system ("find public_html/ -type f -name \*.pm -exec dos2unix {} \;");
        system ("find public_html/ -type f -name \*.cgi -exec dos2unix {} \;");
        system ("find public_html/ -type f -name \*.js -exec dos2unix {} \;");
        echo "\nDone.\n\n";
?>
Personal tools
Online Users
Zoelife4U: