Answer the question
In order to leave comments, you need to log in
How to execute all elements of an array except one in bash, but work out this element in its own way?
Hello!
There is a file with arrays inside. Arrays look like:
declare -A codedep
codedep[array_name]="el1 el2 el3 el4 el5"
#!/bin/bash
CODEPACK_0=$1 # Declare variable codepack name
. codepack_dependency # Include dependent codepack config file
# Triggering jobs for dependent codepacks
if [ "$CODEPACK_0" = "array_name" ] # check if used array_name, then echo elements
then
for i in ${codedep[$CODEPACK_0]}
do
echo $i
done
fi
echo "$i is a super element"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question