$-
contains the current shell options.
In [[ ... ]]
, the right hand side of a =
is interpreted as a pattern if not quoted. Therefore, *i*
means i
possibly preceded or followed by anything.
In other words, it checks wheter the i
option is present, i.e. whether the current shell is interactive.
Related Contents:
- Listing only directories using ls in Bash?
- How to echo shell commands as they are executed
- Bash script and /bin/bash^M: bad interpreter: No such file or directory [duplicate]
- How can I split a large text file into smaller files with an equal number of lines?
- Disable beep in WSL terminal on Windows 10 [closed]
- Can bash show a function’s definition?
- Clone private git repo with dockerfile
- Running script upon login in mac OS X [closed]
- Getting the parent of a directory in Bash
- Can I change the name of `nohup.out`?
- Git doesn’t work on MacOS Catalina: “xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing” [duplicate]
- Only get hash value using md5sum (without filename)
- bash: shortest way to get n-th column of output
- How to check if running in Cygwin, Mac or Linux?
- Bash: Syntax error: redirection unexpected
- bash assign default value
- Is there anything in Zsh like .bash_profile?
- How to specify a multi-line shell variable?
- Relative paths based on file location instead of current working directory [duplicate]
- How does this bash fork bomb work? [duplicate]
- Browsing Folders in MSYS
- HMAC-SHA1 in bash
- Bash command line and input limit
- What do $? $0 $1 $2 mean in shell script? [duplicate]
- Loop background job
- Groups of compound conditions in Bash test [duplicate]
- Are shell scripts sensitive to encoding and line endings?
- How do I test (in one line) if command output contains a certain string?
- Check if array is empty in Bash
- Possible to disable “You have new mail in /var/mail/root”?
- Automated graceful reload of gunicorn in production
- How to cd into a directory with space in the name?
- Insert newline (\n) using sed
- Recreating PyCharm launcher in Ubuntu
- How to get ip address of a server on Centos 7 in bash
- How to install Certbot (Let’s Encrypt) without interaction?
- How to calculate the log of a number using bc?
- The way to distinguish command-mode and insert-mode in Bash’s Vi command line editing
- What is the difference between operator “=” and “==” in Bash?
- Using if elif fi in shell scripts [duplicate]
- Pass command line arguments via sbatch
- Setting environment variable for one program call in bash using env
- What is the reason for the weird syntax of the “case” statement in a bash/zsh script?
- Bash variables with spaces
- Modify Bash prompt prefix in OS X terminal [closed]
- Recursive function in bash
- How can I read a list of filenames from a file in bash?
- Bash Sort like Windows ‘natural sort order’
- How can I derefence symbolic links in bash? [duplicate]
- Using variable interpolation in string in Docker