HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] faxmail and the first page (with body of email)



* Chris Weiss <cweiss@xxxxxxxxx> [080418 15:30]:

> >  Simpler filters, to "blank" the line:
> >         sed -re 's/^-+$//'
> >         sed -e 's/^--*$//'
> >         perl -pe 's/^-+$//''
> >
> >  Or you can completely drop the line:
> >         grep -Ev '^-+$'
> >         grep -v '^--*$'
> >         perl -pe '/^-+$/ && undef $_'
> >
> 
> which would be great if there were just one line and it was all
> repeating chars, but it's not.  I only have the one thing in there as
> a starting point for others to base off of.

Of course, the match expressions can be changed as easily as the shell
script line.  

It seemed like you had been caught by IFS.  And if you're trying to
include that snippet in a larger script, IFS will catch you again.

If you want to avoid the IFS change affecting more than just the read,
you can use it like this:
	while IFS="" read l
	do
		case "$l" in
			"completely suppress this line")                     ;;
			"A line to blank out")                  echo ""      ;;
			"---------------------")                echo ""      ;;
			*)                                      echo "$l"    ;;
		esac
	done

a.

-- 
Aidan Van Dyk                                             aidan@xxxxxxxx
Senior Software Developer                          +1 215 825-8700 x8103
iFAX Solutions, Inc.                                http://www.ifax.com/

Attachment: signature.asc
Description: Digital signature




Project hosted by iFAX Solutions