Running an image based alpine with busybox and ash:
/mnt/builddir/code/src/main/helm # busybox | head -1
BusyBox v1.31.1 () multi-call binary.
I wrote an sh script that prints file's names only if they start with prefix "values", but something with the "if" condition does not work well. This is my script:
for f in ./*
do
echo ${f##*/}
if ${f##*/} == 'values'*; then
echo $f
fi
done
output:
/mnt/builddir/code/src/main/helm # ./script.sh
Chart.yaml
./script.sh: line 4: Chart.yaml: not found
script.sh
./script.sh: line 4: script.sh: not found
values-feature.yaml
./script.sh: line 4: values-feature.yaml: not found
values-int.yaml
./script.sh: line 4: values-int.yaml: not found
values-prod.yaml
./script.sh: line 4: values-prod.yaml: not found
values-stg.yaml
./script.sh: line 4: values-stg.yaml: not found
values.yaml
./script.sh: line 4: values.yaml: not found
before I changed the code to the above, the if condition looked like that:
if [[ ${f##*/} == values* ]]
then
...
But this doesn't work either.
Thanks for you suggestions...
[[ ${f##*/} == values* ]]would make sense; forshobviously not. Also, does not work well and doesn't work either is anecdotal evidence, but not a problem description.