summaryrefslogtreecommitdiffstats
path: root/source3/script/strip_trail_ws.pl
blob: c2c39e21e3cf09be1dc8839a156d5f9a99d5824a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 );