aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-12 18:05:33 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-12 18:05:33 +0200
commit49ddbef55a9e5d561222b36ed5866ff9c722a44a (patch)
treeb4c62bf9b054ca0545c83b02e5d304dc741a12ec /etc
parentef7899f01c6c20b7d18e1b668459a632a989f0b7 (diff)
downloadxutil-49ddbef55a9e5d561222b36ed5866ff9c722a44a.tar.gz
re!: Warn if no shebang instead of dying
Diffstat (limited to 'etc')
-rwxr-xr-xetc/re!6
1 files changed, 5 insertions, 1 deletions
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);