Home    Reference Manuals    Return   



Users Manual for Program FORALL_DO   




Introduction

Program FORALL_DO executes "sub_script" on multiple files.
Program FORALL_DO replaces the following UNIX-code:

  for file in `ls *subst_1*`; do                
   sub_script $file                             
  done                                          


Usage:

                                                        
  forall_do [options] sub_script  subst_1  [subst_2]    
                                                        


Command line options

Following options are understood:

--ext Only search for filenames ending with subst_1
--help Write an information message
--test Do not execute sub_script, only show what is going to be done
     
sub_script Executable script or program which shall operate on all files selected by subst_1
subst_1 Select the files in current directory having the expression subst_1 in their file names.
subst_2 Expression which will replace subst_1 in the names of the created data files


Example:

Rename all files with extension .whe into .wheel:

                                        
  forall_do --ext mv .whe .wheel        
                                        

Translate all PostScript files into PDF-files:

                                        
  forall_do --ext ps2pdf .ps .psd