The -s option to bash doesn't seem to really do anything
When I execute commands with or without it nothing changes. What really confuses me is when I execute a shell script I always seem to be getting an interactive shell. I'm assuming it's interactive because when I use the read builtin in the script it will always prompt me for input. Does this make it interactive?
Do shell script run as interactive in fedora, and are there any examples of a difference that the -s can make? I have read the man pages, but can't seem to generate any examples on my own that would have any effect. I combined the two questions because I was trying to use s to change how the script received input, and in some tutorials they say it has an effect. I realize that it can set arguments, what I don't get is how it changes it to read from standard input it always seems to do that anyway
Here is what I used to test it
if [ -v $PS1 ]
then
echo non-interactive
else
echo interactive
fi
read ; echo $REPLY
read was always able to work in both non and interactive shells
Even when I tested for the presence of fd/0 and fd/1 in non-interactive shells they still existed
Thanks in advance