#!/bin/bash # 20250204 Durtal fridgescan.sh version 3 # A program that collects "fridge" files from the root of gopher holes at circumlunar.space # An array of the colonies at circumlunar.space that is used to loop through the various # gopher holes of each colony colonies=(soviet republic zaibatsu) # The for loop works through each colony in the array "colonies" one at a time for colony in "${colonies[@]}" do # Assigning the dated name of the scan output file to the variable prevents multiple expansions # during the while loop is running output_file="$(date +%Y%m%d)_fridgescan.txt" # The name list for each colony is accessed by cat and piped to the while loop which # reads each name in the list cat "$colony".txt | while read name # The first echo ensures that the name of the sundog precedes their fridge comment # the second echo puts a space between each entry into the output_file # sacc is the gopher app used to access the fridge file in each gopher hole in turn do echo $name >> "$output_file" sacc gopher://"$colony".circumlunar.space/0/"$name"/fridge >> "$output_file" echo >> "$output_file" done done