Typical use case of bash -p set option

Hi all,
Would someone show me a typical situation where using -p set option would be useful ?
Thanks

Welcome cedb92! I'm unsure if this is what you're looking for, but I found this around line 1951 of the man page for bash:

   -p file
          True if file exists and is a named pipe (FIFO).

So I guess its to determine if a file supplied is a named pipe.

That's test -p ... alias [ -p ... ]

set -p might be a logical correspondence of a shebang #!/bin/bash -p
This shebang supresses some uid magic in the case of a suid shell script in Unix. (While Linux does not support suid scripts at all, and the -p option is useless.)

1 Like

There is an explicit and more general connection in the Bash Reference Manual:

Section 6.1 -- Invoking Bash.

All of the single-character options used with the set builtin (see The Set Builtin) can be used as options when the shell is invoked. In addition, there are several multi-character options that you can use. These options must appear on the command line before the single-character options to be recognized.

The part about the order of options seems a little strange.

Hi,
Yes after having tried to setuid bash script on linux, that doesn't work, and this option is thus useless for linux. I was wondering wether this behaviour might be linked to some hidden security mechanism that could get disabled, but as you say it's a linux feature.
Thanks for the answer and the confirmation !