Bug 247410

Summary: sh(1): Document that if the dot command fails to find and source the file, the whole script fails
Product: Base System Reporter: Mateusz Piotrowski <0mp>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me Keywords: needs-patch
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Mateusz Piotrowski freebsd_committer freebsd_triage 2020-06-19 09:42:55 UTC
Let's consider the following script:

```
echo 1
[ 
echo 2
. /nonexistent
echo 3
```

The output of the script is:

```
1
[: missing ]
2
.: cannot open /nonexistent: No such file or directory
```

As we can see, the dot builtin does aborts the script if it cannot source the desired file, while some other builtins, like [ in this example, just print an error message and let the script proceed.

We should probably document this behavior.