mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 22:50:10 +08:00
537b3f6cb1
Otherwise we might get "text file is busy", or worse no error at all. Hoping .2 seconds is enough here.
26 lines
750 B
Fish
26 lines
750 B
Fish
#RUN: %fish %s
|
|
exec cat <nosuchfile
|
|
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
|
|
#CHECKERR: open: No such file or directory
|
|
echo "failed: $status"
|
|
#CHECK: failed: 1
|
|
not exec cat <nosuchfile
|
|
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'
|
|
#CHECKERR: open: No such file or directory
|
|
echo "neg failed: $status"
|
|
#CHECK: neg failed: 0
|
|
|
|
set -l f (mktemp)
|
|
echo "#!/bin/sh"\r\n"echo foo" > $f
|
|
chmod +x $f
|
|
# Cheesy sleep to avoid "text file is busy"
|
|
sleep 0.2
|
|
$f
|
|
#CHECKERR: Failed to execute process '{{.*}}'. Reason:
|
|
#CHECKERR: The file uses windows line endings (\r\n). Run dos2unix or similar to fix it.
|
|
|
|
# This needs to be last, because it actually runs exec.
|
|
exec cat </dev/null
|
|
echo "not reached"
|
|
|