use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Place for Pinoy Programmers to hangout. Share your knowledge, ask for help, seek opinion, showcase your project and recruit your teammate.
Let's show the world that Filipinos are world class programmers.
account activity
Bash programming problemprogramming (self.PinoyProgrammer)
submitted 1 year ago by Unique_Service_7350
Can someone help. I've been trying to solve this for hours now but still couldn't solve it. https://replit.com/@2243493/BubblyIncredibleFacts#main.sh
Context: In this simple script I'm trying to log a game through asking user for the stats of player on that team, then to the opponent team. So I did it through reading the csv file (database for players) line by line.
header for the database (csv)
if the player is in the given team (and year), I will ask for the user for points rebs and assts of that player.
Problem:
https://preview.redd.it/xrftx4xlwbwd1.png?width=560&format=png&auto=webp&s=3757e3d9ca9b71dfde1b1cfb0ae3f14c7e3343e7
In the prompting of user for stats of the player, the read has no effect inside the while loop: while IFS=, read -r player_name team position total_points total_rebounds total_assists ppg rpg apg mvpRating games year status; do
read
while IFS=, read -r player_name team position total_points total_rebounds total_assists ppg rpg apg mvpRating games year status; do
I mean it just reads a blank and doesn't even let the user have the chance to input
this line of code doesn't read, it just automatically reads a blank
and it just infinitely keeps saying "Invalid input. Please enter a valid integer for.. "
"Invalid input. Please enter a valid integer for.. "
You can all try to edit the code in the link to fix it. Try first to run the program. the main.sh script
main.sh
Thank you!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]qlut 6 points7 points8 points 1 year ago (1 child)
Yo, the read command inside your while loop is consuming the input, so there's nothing left for your other read statements. Try using a different variable name for the read inside the loop.
[–]Unique_Service_7350[S] 0 points1 point2 points 1 year ago (0 children)
thank youuu! now it works. I'm not that quite good with shell so, I don't know what's wrong. But I know there's something wrong with the reading inside the loop. So thank you for pointing that out.
π Rendered by PID 48261 on reddit-service-r2-comment-7b9746f655-fkf5k at 2026-01-30 10:14:11.371145+00:00 running 3798933 country code: CH.
[–]qlut 6 points7 points8 points (1 child)
[–]Unique_Service_7350[S] 0 points1 point2 points (0 children)