You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two ways of giving the program text crash instead of running or reporting an
error:
-f with a file that cannot be opened panics on unwrap();
--source TEXT (-e) without -f panics because the code looks for the
positional program argument.
Reproduction
Rust (incorrect)
$ ./target/release/awk -f missing.awk
thread 'main' panicked at parser/src/lib.rs:1037:38:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }# Exit code: 2$ ./target/release/awk --source 'BEGIN { print 1 }'thread 'main' panicked at src/main.rs:51:43:called `Option::unwrap()` on a `None` value
GNU (correct)
$ gawk -f missing.awk
gawk: fatal: cannot open source file `missing.awk' for reading: No such file or directory# Exit code: 2$ gawk --source 'BEGIN { print 1 }'1
Activity