There is no mistake in your bash script. But you are executing it with sh which has a less extensive syntax 😉
So, run bash ./choose.sh
instead 🙂
More Related Contents:
- sh: 1: Syntax error: "(" unexpected error
- Iterate over a list of files with spaces
- How to declare 2D array in bash
- Defining a variable with or without export
- What does $@ mean in a shell script?
- Better way to rename files based on multiple patterns
- How to join multiple lines of file names into one with custom delimiter?
- Syntax error in shell script with process substitution
- Raise error in a Bash script
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- How to handle more than 10 parameters in shell
- Linux bash: Multiple variable assignment
- How to sort a file in-place?
- How to preserve line breaks when storing command output to a variable?
- Changing default shell in Linux [closed]
- How to use sed to remove the last n lines of a file
- Example of using named pipes in Linux shell (Bash)
- Passing variables in remote ssh command
- How do I run multiple background commands in bash in a single line?
- Execute command after every command in bash
- How do I change bash history completion to complete what’s already on the line?
- How to join multiple lines of filenames into one with custom delimiter
- Multithreading in Bash [duplicate]
- Running shell script in parallel
- Difference between shell and environment variables
- SUID not working with shell script
- What’s the point of eval/bash -c as opposed to just evaluating a variable?
- How to convert hex to ASCII characters in the Linux shell?
- Linux shell script to add leading zeros to file names
- How to avoid race condition when using a lock-file to avoid two instances of a script running simultaneously?