From 49ddbef55a9e5d561222b36ed5866ff9c722a44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 12 Jul 2021 18:05:33 +0200 Subject: re!: Warn if no shebang instead of dying --- etc/re! | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/re! b/etc/re! index 1314ae9..1cd2198 100755 --- a/etc/re! +++ b/etc/re! @@ -18,7 +18,11 @@ for my $file (@ARGV) { # parse shebang my $shebang = <$o>; - $shebang =~ /^#!/ or die "no shebang: $file\n"; + if (not $shebang =~ /^#!/) { + warn "no shebang: $file\n"; + close $o; + next; + } $shebang =~ /^#!\s*(\S+)\s*(.*)/; my ($old, $args) = ($1, $2); -- cgit v1.2.3