[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] whitespace



On Wed, 20 Sep 2000, Ken Nagorski wrote:
> 	Anyone know how  can strip whitespaces off the end of each line of
> a file, be it perl, bash...whatever. There has got to be a way. I just
> can't get it to work?

	sed 's/[ 	][ 	]$//' <file1 >file2
	# that's space & tab in the square brackets above

	perl:

	while (<>) {
		s/\s+$//;
		print;
	}

Danny

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.