Created
January 27, 2020 16:30
-
-
Save cgrusden/11164442b2324ff31a5baf9893921fe1 to your computer and use it in GitHub Desktop.
Utility Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Rename files in subdirectories to the names of the sub directory | |
# and place them in the current directory | |
# This script needs help. but it works | |
for d in $1*; do | |
if [ -d "$d" ]; then | |
echo "Dir: $d" | |
cp $d/*.html $(echo "$d" | sed -E 's/source\/(.+)?$/source\/\1\.md/g') | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment