"SfR Fresh" - the SfR Freeware/Shareware Archive


up home help comments

Short description: Search and replace patterns in files and subdirectories
Alternative downloads: Z | gz | bz2 | zip

treesed (17 Nov 1997, 3666 Bytes)

File type: perl script text
Short impression (the first 25 of 189 lines):
#!/bin/perl

# treesed
# Written January 1996 by Rick Jansen (rick@www.bpa.nl)
# All rights reserved.
# URL: http://www.sara.nl/rick

# usage: treesed pattern1 pattern2 -tree 
#        treesed pattern1 pattern2 -files file1 file2 ... 

# example: treesed href HREF -files *.html

# Treesed searches for pattern1 and replaces pattern1 by pattern2
# if pattern2 supplied. If only pattern1 given treesed just searches.
# Treesed will search in all files and subdirectories of the current
# directory



#--------------------------------------------------------
# Parameters

$DoEdit=0;
$search_pattern = $ARGV[0];
$search_pattern =~ s/(\W)/\\$1/g;  # escape regexp chars