1

I am trying to write a bash script which can get all the file names from a folder and execute another Python script which takes one file name at a time.

How do I do that?

1
  • 1
    Sounds like a pretty simple case for a for command. Commented Oct 27, 2015 at 23:56

1 Answer 1

3
for file in /path/*
do
  python main.py "$file"
done
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.