Fixed read to prevent mangling backslashes

This commit is contained in:
Ben Ashton 2022-09-03 02:25:44 -06:00
parent dece3c5934
commit ff77585d33
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ printf '%s\n' '</h1>';
printf '%s\n' ' <p>From the following restaurants:</p>';
printf '%s\n' ' <ul>';
# Loop through restaurants and display each one
while read restaurant; do
while read -r restaurant; do
printf '%s' ' <li>';
printf '%s' "$restaurant" | jq -Rrj @html;
printf '%s\n' '</li>';

View File

@ -10,7 +10,7 @@ $ title='My Restaurant Randomizer';
<p>From the following restaurants:</p>
<ul>
# Loop through restaurants and display each one
$ while read restaurant; do
$ while read -r restaurant; do
<li><% $restaurant %></li>
$ done <restaurants.txt
</ul>