Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I see that MinGW shell launches with

sh --login -i

Another way to launch would be like this

sh --login

I know that -i is for interactive shell, but I am not seeing a difference between the two commands.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Interactive mode is the default if you don't pass a command to run via -c, and if the standard input/output streams are mapped to terminals.

So specifying -i on the command line is not necessary. It can be in some situations in scripts or when invoking a shell from another program.

See the INVOCATION section in the bash man page:

An interactive shell is one started without non-option arguments and without the -c option whose standard input and error are both connected to terminals (as determined by isatty(3)), or one started with the -i option. [...]

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.