Fabian Boehm
20243132fb
Add <?
input redirection
...
This tries to open the given file to use as stdin, and if it fails,
for any reason, it uses /dev/null instead.
This is useful in cases where we would otherwise do either of these:
```fish
test -r /path/to/file
and string match foo < /path/to/file
cat /path/to/file 2>/dev/null | string match foo
```
This both makes it nicer and shorter, *and* helps with TOCTTOU - what if the file is removed/changed after the check?
The reason for reading /dev/null instead of a closed fd is that a closed fd will often cause an error.
In case opening /dev/null fails, it still skips the command.
That's really a last resort for when the operating system
has turned out to be a platypus and not a unix.
Fixes #4865
(cherry picked from commit df8b9b70954fd38c170b954967112d50ba299223)
2024-04-21 14:35:13 +02:00
..
2019-06-25 22:31:06 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 15:33:05 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-18 23:27:05 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2019-11-02 16:48:08 -07:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 15:34:21 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-15 08:32:31 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 15:33:05 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-21 14:35:13 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-21 14:25:54 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 15:33:05 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-21 14:25:54 +02:00
2024-04-21 14:25:54 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 14:36:11 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-13 20:23:51 +02:00
2024-04-13 18:24:53 +02:00
2024-04-19 12:05:27 +02:00
2024-04-19 12:05:27 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00
2024-04-12 12:28:22 +02:00