File: clear_affix.pl

package info (click to toggle)
igerman98 20131206-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,136 kB
  • ctags: 181
  • sloc: perl: 926; makefile: 523; sh: 102; sed: 32
file content (22 lines) | stat: -rwxr-xr-x 362 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
	if $running_under_some_shell;

while ($ARGV[0] =~ /^-/) {
	$_ = shift;
	last if /^--/;
	if (/^-n/) {
$nflag++;
	next;
	}
	die "I don't recognize this switch: $_\\n";
}
$printit++ unless $nflag;

$\ = "\n";	# automatically add newline on print

while (<>) {
	chop;
	s|(.*)/.*$|$1|;
	print if $printit;
}