github - How do if fix theses syntax errors with this bash script - Stack Overflow
I've been searching the web to find a Bash dialog script for my project I've found one and I'm trying to edit the script so when you execute the script, the script will prompt the user what option you want to select, once the user has selected that option it will execute a script that runs another dialog box and prompts the user more options to select a repository, once the user selected a repository it will execute a command using curl to run a Bash script that checks what distro you are using and install it using curl
and then use curl to install docker and runs a Bash script that runs the compose.yml file and exits after the compose file is finished. The bash scripts are from the Github repository Dialog.
The blockquote text will be added to the script in the future once the syntax errors are fixed
Bash Script file name: "dialog.sh"
#!/bin/bash
echo "Installing Required packages curl git"
sudo apt install -y git curl
cd ~/
echo -e "git cloning /"
cmd=(dialog --separate-output --checklist "Select options:" 22 76 16)
options=(1 "Install Docker" off # any option can be set to default to "on"
(2 "LinuxServer" off
(3 "Other Options" off
(4 "Exit" off
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices
do
case $choice in
1) echo -e "Installing ${BCyan}Docker"
curl -fsSL / | bash
echo "Done installing Docker"
;;
2)
echo "You've selected LinuxServer"
curl -fsSL
.sh | bash
;;
3)
echo "Youve Pick other options"
;;
4)
echo "Exiting"
exit :1
;;
esac
done
when you execute the bash script using this command "bash dialog.sh" you get the following error
dialog.sh: line 15 syntax error near unexpected token `)'
dialog.sh: line 15: `2)'
when you execute test.sh using this command "bash test.sh" you get the following error
test.sh: line 8: syntax error near unexpected token `('
test.sh line 8: ` (2 "LinuxServer off'
test.sh line 8: syntax error: unexpected end of file
NOTE: The blue highlighted text "test.sh" is the url to the raw format of the script
- Rambus联手微软:研究量子计算内存
- 美学者发现比特币重大漏洞:能导致货币体系崩溃
- Spring Boot 3: Exclude REST Endpoints from Authorization - Stack Overflow
- pycharm - Why would the python code throw an exception (invalid instance in App.root), if "@property" is remov
- material ui - Using ShadowDOM to address MUI 5 vs MUI 6 Compatibility Issue? - Stack Overflow
- bitcoin - Problem with sign PSBT.Error sign transaction - Stack Overflow
- c# - Is there a way to fill scriptable object field with a child class? - Stack Overflow
- Laravel Livewire Pagination is not responsive - Stack Overflow
- sql - PostgreSQL ERROR: cannot accumulate arrays of different dimensionality - Stack Overflow
- dart - Flutter - dyld: lazy symbol binding failed: Symbol not found: _os_log_create - Stack Overflow
- c++ - templates are instantiated despite having extern template - Stack Overflow
- python 3.x - why is sqllachemy returning a class instead of a string - Stack Overflow
- html - Need help getting a button with a drop-down menucontent in it to be centered and to push content down - Stack Overflow
- ms access - Execute VBScipt on local machine, triggered from remote desktop - Stack Overflow
- javascript - Unable to locate tests within a folder - Stack Overflow
- node.js - Attach .pfx certificate to nodejsaxios HTTP request - Stack Overflow
- https - ASP.NET app is not listening on port 5001 after deployment - Stack Overflow