skip to Main Content

How to create list in shell using for loop – CentOS

I am trying to create a new array using for loop Images="alpine ubuntu centos" Image_tags="$(for i in $Images; do r_madoori1/$i done)" echo $Image_tags I am expecting Image_tags="r_madoori1/alpine r_madoori1/ubuntu r_madoori1/centos" instead i am getting below error ./shell.sh: line 7: r_madoori1/alpine: No…

VIEW QUESTION

Bash get php versions available for apache

I want to get a list of all versions of PHP that have the apache module installed. This is my function : availableVersions () { available_versions=""; for php_version in `ls -d /etc/php/*/apache2` do available_versions="${available_versions}| ${php_version} "; done echo $available_versions; }…

VIEW QUESTION
Back To Top
Search