Skip to content

Instantly share code, notes, and snippets.

View Nutlope's full-sized avatar
💭
Building

Hassan El Mghari Nutlope

💭
Building
View GitHub Profile
@Nutlope
Nutlope / readme_script.sh
Created March 16, 2022 02:17
Script that modifies hundreds of READMEs in a folder
#!/bin/bash
# Script to perform bulk action on READMEs in the `examples` repo
for FILE in *; do
# Get line where ### Preview starts
PREVIEW_LINE=$(sed -n '/## Preview/=' $FILE/README.md);
# If the preview section doesn't exist in the file, move on to the next folder
if [ -z "$PREVIEW_LINE" ]; then
echo "there's nothing"