0

I have three bash scripts which will give output with options.

./script_1 list ./script_2 list ./script_3 list ./script_9 list

and these numbers differs with servers but the first word in every server is "script".

now I want to run all these scripts together with same option 'list'. I need something like ./script_* list ?? or a command with ls or awk or anything else..

Running the process in background is not fulfilling my solution as I appended it into another script.

Inian
  • 71,145
  • 9
  • 121
  • 139

1 Answers1

2
for i in ./script_*; do
    $i list
done

If this is not the use case you're seeking, you'll have to be more specific in your question.

jeremysprofile
  • 8,199
  • 4
  • 30
  • 47
  • 1
    @jeremysprofile : Note that, unless you do a `shopt -s nullglob`, this would produce an error message if no script_ files are present. – user1934428 Jul 06 '18 at 09:04