diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-06 19:18:01 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-06 19:18:01 +0100 |
| commit | 57a7db00ea956b6ee87ae3d6ae61ce21e9b62cf4 (patch) | |
| tree | cdb7c6bcaf4622487fe94bb400af0432234654a7 | |
| parent | 0a57c9e5cfd9c59d2b6156c1afd050f55c3c21d9 (diff) | |
| download | sebastiano.tronto.net-57a7db00ea956b6ee87ae3d6ae61ce21e9b62cf4.tar.gz sebastiano.tronto.net-57a7db00ea956b6ee87ae3d6ae61ce21e9b62cf4.zip | |
Fixed script
| -rw-r--r-- | src/blog/2025-11-29-aoc-download/aoc-download.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blog/2025-11-29-aoc-download/aoc-download.md b/src/blog/2025-11-29-aoc-download/aoc-download.md index a563955..29e56fc 100644 --- a/src/blog/2025-11-29-aoc-download/aoc-download.md +++ b/src/blog/2025-11-29-aoc-download/aoc-download.md | |||
| @@ -100,7 +100,8 @@ url="https://adventofcode.com/$year/day/$daynozero" | |||
| 100 | curl "$url" | sed -n '/<pre><code>/,/<\/code><\/pre>/ p' | (\ | 100 | curl "$url" | sed -n '/<pre><code>/,/<\/code><\/pre>/ p' | (\ |
| 101 | i=1 | 101 | i=1 |
| 102 | rm -f "code-$i.txt" | 102 | rm -f "code-$i.txt" |
| 103 | while read line; do | 103 | IFS='' |
| 104 | while read -r line; do | ||
| 104 | if [ "$line" = "</code></pre>" ]; then | 105 | if [ "$line" = "</code></pre>" ]; then |
| 105 | i=$((i + 1)) | 106 | i=$((i + 1)) |
| 106 | rm -f "code-$i.txt" | 107 | rm -f "code-$i.txt" |
| @@ -110,4 +111,3 @@ curl "$url" | sed -n '/<pre><code>/,/<\/code><\/pre>/ p' | (\ | |||
| 110 | done | 111 | done |
| 111 | ) | 112 | ) |
| 112 | ``` | 113 | ``` |
| 113 | |||
