Bash - Interactive Shell

> Procedural Languages > Bash Shell and (Unix|Linux) Utilities (XCU)

1 - About

An interactive shell is when bash is:

Advertising

3 - Management

3.1 - Argument

When invoking an interactive shell, you can set the positional parameters with the -s option of bash. See Bash - Bash cli

3.2 - Testing for Interactive mode

  • Testing for Interactive mode
if [[ $- == *i* ]]
then
    echo "Interactive"
fi

where