Make sure the version of bash being invoked as interpreter at the top of your shell script (#!/bin/bash
or whatever) is also version 4. If you’re doing:
bash --version
and it’s giving you v4, do a which bash
to check it’s location.
More Related Contents:
- How to define hash tables in Bash?
- Associative arrays in Shell scripts
- How to iterate over associative arrays in Bash
- In Bash test if associative array is declared
- Multidimensional associative arrays in Bash
- Echo newline in Bash prints literal \n
- In the shell, what does ” 2>&1 ” mean?
- An efficient way to transpose a file in Bash
- ssh breaks out of while-loop in bash [duplicate]
- Remove a fixed prefix/suffix from a string in Bash
- I just assigned a variable, but echo $variable shows something else
- In bash, how do I expand a wildcard while it’s inside double quotes?
- Bash expand variable in a variable
- How to check if a process id (PID) exists
- Variable expansion is different in zsh from that in bash
- Execute “ffmpeg” command in a loop [duplicate]
- Cron jobs and random times, within given hours
- Shell variables set inside while loop not visible outside of it
- Single script to run in both Windows batch and Linux Bash?
- Detect if PATH has a specific directory entry in it
- Piping and Redirection
- Reading filenames into an array
- bash recursive xtrace
- Bash: Parse CSV with quotes, commas and newlines
- How to pipe stdout while keeping it on screen ? (and not to a output file)
- Unable to forward search Bash history similarly as with CTRL-r
- How to wait for an open port with netcat?
- run bash command in new shell and stay in new shell after this command executes
- How to produce cartesian product in bash?
- Groups of compound conditions in Bash test [duplicate]