Creating a bash script that is running against a wiki page to check for contributions right now. The script currently requires you to enter each username 1 by 1 and then press enter and it runs against the entirety of the list.
I want to do something like this
#! /bin/bash
users="user1,user2,user3,user4,user5 etc"
echo $users \n | <script.py>
But I cant get it to return the new line and run automatically, it currently just enters the users but wont "press enter" for me, lazy I know but trying to learn how to script and this seemed like a good in.
Any help would be greatly appreciated, thanks!
EDIT:
Here is the portion of the python code that requires an input of aliases/usernames and then when the user (me) has entered them you press enter on the KB and the script runs
aliases_input = str(input("Enter comma separated alias(es): "))
aliases = aliases_input.split(",")
summary = []
try:
for alias in aliases:
df, total_activity_count = get_contributions(alias)
summary.append({"alias": alias, "totalContributions": total_activity_count})
summary_table = pd.DataFrame(data=summary)
print(
"Getting total contributions for:",
alias,
"\n",
df,
"\n",
"Total Contributions:",
total_activity_count,
"\n",
)
print("Summary of all aliases", "\n", summary_table)
except UnboundLocalError:
pass```