Hi All ,
This simple script runs fine in bash script ,
however in bitbucket pipeline it fails
- for folders in `ls -l | grep '^d' | awk '{print $9}'`
- do
- if [ -d $folders ];then
- echo $folders
- cd $folders
- sed -i.bak 's/markdown-header-//g' README.md
- cd ..
- fi
- done
Error is bash: /opt/atlassian/pipelines/agent/tmp/bashScript8148302414251698626.sh: line 69: syntax error near unexpected token `printf'
Any help
The pipeline itself is YAML, so you'll need to do it like this:
- >
for dir in $(ls -l | grep '^d' | awk '{print $9}'); do
echo $dir
echo "do something else"
done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.