The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Please help me with this simple script Blue UNIX for Dummies Questions & Answers 6 11-07-2008 01:40 PM
Simple script wakhan Shell Programming and Scripting 6 09-17-2008 03:44 PM
Help with a simple script using awk alexcol Shell Programming and Scripting 3 10-23-2006 04:28 AM
Need a simple script Relykk Shell Programming and Scripting 10 03-16-2004 10:18 AM
Simple VI script brassmon_k UNIX for Dummies Questions & Answers 3 02-09-2001 12:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-06-2009
klaasjan klaasjan is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 1
simple script

Experts, i've made a script in PHP. I'm looking for a script wat does the same but for Unix. Is there anyone who can make this for me (for free).

I understand that normally you will only help and not make complete scripts but...

With kindly regards

Klaasjan Boven

PHP Code:
<?php
 
// datum zetten
$datum =  date("Ymd");
 
// kijken of we de dir open kunnen krijgen en $handle  initieren
if ($handle opendir('/usr/local/Zend/apache2/htdocs/bag/'))  {
   
  
/* Door de dir loopen. */
    
while (false !== ($file =  readdir($handle))) {
    
     
// de . en de .. uitsluiten
      
if  ($file == "." || $file == ".."){
      
         
// kijken of het een  directory is
     
if(is_dir($file)){
             
        
//als het  een dir is dan maken we het pad weer compleet
      
$mapje =  '/usr/local/Zend/apache2/htdocs/bag/'.$file.'/';
        
           
//  weer kijken of het een dir is
       
if(is_dir($mapje)){
          
           
// weer kijken of we hem open kunnen krijgen
        
if($gaan =  opendir($mapje)){;
        
             
// door dir loopen en bestand  zetten
         
while (false !== ($bestand readdir($gaan))) {
                
           
// kijken of het een dir is
                 
if(is_dir($bestand) && $bestand != '.'){
                     
                 
// directorynaam uitlezen                  
                     
$dirname dirname($bestand);
                    
                                       
                 
// we hebben nu het mapje van  vandaag
                    
if(!strstr($bestand,2) && $bestand !=  '.'){ 
                     
                     
// nu hebben we de  dirname
                     
$bestand =  '/usr/local/Zend/apache2/htdocs/bag/'.$bestand;
                      
                  
// weer kijken of we kunenn openen 
                       
if($openenen opendir($bestand)){
                       
                        while (
false !== ($tekst readdir($openenen))) {
                         
                        
// kijken naar het goede  bestand
                        
if($tekst == 'job.dat'){
                         
                         
// path weer compleet maken 
                          
$tekst $bestand.'/'.$tekst;
                          
// inhoud van de file  ophalen                          
                         
$blaat =  file_get_contents($tekst);
                         
                          echo 
'ik ben bij '.$tekst.'<br>';
                         
                          
// kijken of we de juiste string voorkomt
                          
if(!strstr($blaat,'uitgevoerd returncode 0'))
                          
                         
// zo nee mailen
                          //echo 'mailen !!'; 
                         
$string '<font  color="red">'.$tekst.' bevat de string niet</font><br>';
                          
mail('klaasjan.boven@mail',$string,$blaat);
                  }
                        
                        }
                       
                     }
                    
                     }                   
                     
                 }
                
                }
                    
          }
                  
         }
          
      }
       
         }
    
     }
     
closedir($handle);
}
//echo  $datum;
?>
  #2 (permalink)  
Old 01-06-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,294
klaasjan,

It should be better to clarify what you're trying to achieve.

Regards
  #3 (permalink)  
Old 01-06-2009
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,952
Quote:
I understand that normally you will only help and not make complete scripts but...
Ok. So, what does that mean here?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0