I'm trying to run this if statement in Bitbucket Pipelines to update/append values to a file, but when I run it, the pipeline gets stuck on the if statement. These all work in a terminal but not in BitBucket Pipelines. I've tried variations shown below.
- keys=`grep -o "key_.*=" key_values`
- if (grep -q $keys key_values); then echo "replace"; else echo "append"; fi
- keys=`grep -o "key_.*=" key_values`
- if grep -q $keys key_values; then echo "replace"; else echo "append"; fi
- if (grep -q `grep -o "key_.*=" key_values` key_values); then echo "replace"; else echo "append"; fi
Any feedback/corrections would be appreciated