File: protect-quote.pl

package info (click to toggle)
fortunes-es 1.36%2Bnmu1
  • links: PTS
  • area: main
  • in suites: sid, trixie
  • size: 1,304 kB
  • sloc: ansic: 629; makefile: 161; sh: 153; perl: 40
file content (14 lines) | stat: -rwxr-xr-x 184 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl -w
#
my $quote=0;
while (<STDIN>) {
	chomp;
	$quote = 1 if  /^\s+--/ ;
	$quote = 0 if  /^%/ ;
	if ( $quote ) {
		print "%$_\n"; 
	} else {
		print "$_\n";
	}
}
exit 0;