Reputation:
I'm trying to run a script that uses the select command and I get error below. I'm running the most recent version of ubuntu. Why does it say the commands are not found?
#!/bin/bash
# Scriptname: runit
PS3= "Select a program to execute: "
select program in 'ls -F' pwd date cal exit
do
$program
done
runit.sh: 3: Select a program to execute: : not found
runit.sh: 4: select: not found
runit.sh: 5: Syntax error: "do" unexpected
Upvotes: 0
Views: 2318
Reputation: 361655
Delete the space after the equal sign:
PS3= "Select a program to execute: "
^
Upvotes: 1