34 print
"changeENV starting....\n";
35 $opts = getopt(
'hc:');
37 $Usage =
"{$argv[0]}: [-h] -c <change-string>\n";
44 if (array_key_exists(
"h",$opts)) {
51 if (array_key_exists(
"c",$opts)) {
52 $change2 = $opts[
'c'];
53 if(!strlen($change2)) {
63 $testEnv =
'../../../tests/TestEnvironment.php';
65 $sedLine =
"sed -e \"1,$ s/USER=.*/USER='$change2';/\" ".
66 "-e \"1,$ s/WORD=.*/WORD='$change2';/\" $testEnv 68 $changed = exec($sedLine, $out, $rtn);
71 $FH = fopen($testEnv,
'w') or die("Can't open $testEnv\n $phpErrorMsg");
72 foreach ($out as $line) {
73 if(FALSE === fwrite($FH,
"$line\n")) {
74 print
"FATAL! cannot wite to $testEnv\n";