On Thu, Jul 02, 2020 at 12:46:33AM +0700, Robert Elz wrote:
> POSIX says:
> 
>       If command is specified, exec shall not return to the shell;
> 
> but in bash...
> 
>  bash
> jinx$ echo $$
> 23361
> jinx$ exec :
> bash: exec: :: not found
> jinx$ echo $$
> 23361

You're in an interactive shell.  Bash chose this behavior to make your
life better.

unicorn:~$ cat foo
#!/bin/bash
exec :
echo "I am still here"
unicorn:~$ ./foo
./foo: line 2: exec: :: not found
unicorn:~$ 

Reply via email to