<?php
//#$dir_search=$_GET['dir'];
$name_search=$_GET['name'];
//cesta a samotny soubor
$file="search.sh";
//pokud soubor neexistuje... pak
//if( !file_exists($file)) {
$fp = fopen($file, "w"); // ("r" - cist "w" - vytvorit "a" - pridat k textu), vytvarejeme soubor
fwrite($fp, "#!bin/bash\n grep -lr '".$name_search."' ./ > ok.txt");
//fwrite($fp, "grep -lr '".$name_search." ".$dir_search." > ok.txt");
fclose ($fp);
exec ("sh ".$file);
//}
?>
