The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

For Loop to traverse over Project Folder and get the filenames

Suvojit Ghosh
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 18, 2022

Implementing a shell script and calling the .sh file from bitbucket pipeline.yml

Currently facing an issue to retrieve the files inside a folder in the source code. 
need to execute the class files as a post deployment step.

I am using For loop:

for f in /deploy/scripts/* .cls do

echo “$f”

done

 

the output should be the the class filenames inside scripts folder but it simply returns the string 

/deploy/scripts/* .cls

any help or advice how to resolve this?

thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Ankit Gupta
Contributor
March 20, 2022

That isn't the proper syntax, you need to run:

for f in $(ls /deploy/scripts/*.cls); do echo "$f"; done;
TAGS
AUG Leaders

Atlassian Community Events