The prompt went like this,
Write a unix shell executable for mac which lives in a directory alongside images with .jpg extensions. The executable creates a markdown file named geminiTest.md with an element for every image in the directory. The alt text for each image is the filename + " film photo from Unsplash". Each image element in the markdown document has a file path of "/static/img/geminiTest/" prepended. For example, the output for one image in the markdown document will look like:
![sample.jpg film photo from Unsplash](/static/img/geminiTest/sample.jpg)
To which Gemini replied,
#!/bin/bash
# Create the markdown file
echo > geminiTest.md
# Find all .jpg files in the current directory
for filename in *.jpg; do
# Construct the markdown image element
alt_text="${filename} film photo from Unsplash"
image_path="/static/img/geminiTest/${filename}"
markdown_element="![$alt_text]($image_path)"
# Append the element to the markdown file
echo $markdown_element >> geminiTest.md
done
After saving the script, making it executable, and plopping the files into the same directory,
![annie-spratt-6wd1f4Zjo_0-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/annie-spratt-6wd1f4Zjo_0-unsplash.jpg)
![annie-spratt-BSNEY967eI0-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/annie-spratt-BSNEY967eI0-unsplash.jpg)
![annie-spratt-f_q-PzGyf1U-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/annie-spratt-f_q-PzGyf1U-unsplash.jpg)
![kevin-laminto-tqvzVI_2XK4-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/kevin-laminto-tqvzVI_2XK4-unsplash.jpg)
![lawrence-chismorie-zvWXn5c3H7o-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/lawrence-chismorie-zvWXn5c3H7o-unsplash.jpg)
![waldemar-mad-9SN77B5_grY-unsplash.jpg film photo from Unsplash](/static/img/geminiTest/waldemar-mad-9SN77B5_grY-unsplash.jpg)
Feel free to get in touch with any questions.