diff options
Diffstat (limited to '')
-rwxr-xr-x | source3/script/strip_trail_ws.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/script/strip_trail_ws.pl b/source3/script/strip_trail_ws.pl new file mode 100755 index 0000000..c2c39e2 --- /dev/null +++ b/source3/script/strip_trail_ws.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl -w + +open( INFILE, "$ARGV[0]" ) || die $@; +open( OUTFILE, ">$ARGV[0].new" ) || die $@; + +while ( <INFILE> ) { + $_ =~ s/[ \t\r]*$//; + print OUTFILE "$_"; +} + +close( INFILE ); +close( OUTFILE ); + +rename( "$ARGV[0].new", "$ARGV[0]" ) || die @_; + +exit( 0 ); + + |