• 1000 1008 *: 101: /home/ubuntu/create.sh: неверная подстановка.
Код:
#!/bin/bash
tools_list="nginx/ldap/mongo/cloveplatformui"
tools_list1=`echo $tools_list | sed 's/ //g'`
tools_list2=`echo $tools_list1 | sed 's/$/\//'`
tools_list3=`echo $tools_list2 | sed 's@/@.yml @g'`
tools_list4=`echo $tools_list2 | sed 's@/@.conf @g'`
#tools_list_array=($tools_list6)
#tools_conf_array=($tools_list8)
#echo $tools_list_array
sudo touch docker-compose.yml
sudo chmod -R 755 docker-compose.yml
sudo chown -R ubuntu:ubuntu docker-compose.yml
sudo echo '---' >> docker-compose.yml
sudo echo 'version: "3.3"' >> docker-compose.yml
sudo echo 'services:' >> docker-compose.yml
# Print array values in one line
echo "Print all elements in a single line"
for val in "${tools_list3[@]}\" ; do
sudo cat $val >> docker-compose.yml
done```