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
  • 80,270
  • 14
  • 142
  • 161
Saikiran
  • 140
  • 14

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
  • 10,028
  • 4
  • 33
  • 53
  • 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