Last active
January 25, 2022 05:34
-
-
Save theagoliveira/f918aa349ac64b25dc45faf691e2b40b to your computer and use it in GitHub Desktop.
Recreate LaTeX project directory structure inside build folder
This file contains hidden or 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
#!/usr/bin/env bash | |
# SOURCE: https://tex.stackexchange.com/questions/323820/i-cant-write-on-file-foo-aux/485273#485273 | |
# find all directories which are not the destination dir or inside it | |
find "$1" -maxdepth 1 -type d -not -name "$2" -not -path "$1/$2/*" -not -path "$1" -printf '%P\n' \ | |
| while IFS= read -r dir | |
do | |
cp -r "$1/$2/${2}_$3/$dir" "$1/$2" | |
done |
This file contains hidden or 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
#!/usr/bin/env bash | |
# SOURCE: https://tex.stackexchange.com/questions/323820/i-cant-write-on-file-foo-aux/485273#485273 | |
# find all directories which are not the destination dir or inside it | |
find "$1" -maxdepth 1 -type d -not -name "$2" -not -path "$1/$2/*" -not -path "$1" -printf '%P\n' \ | |
| while IFS= read -r dir | |
do | |
cp -r "$1/$2/$dir" "$1/$2/${2}_$3" | |
done |
This file contains hidden or 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
#!/usr/bin/env bash | |
# SOURCE: https://tex.stackexchange.com/questions/323820/i-cant-write-on-file-foo-aux/485273#485273 | |
# find all directories which are not the destination dir or inside it | |
find "$1" -type d -not -name "$2" -not -path "$1/$2/*" -printf '%P\n' \ | |
| while IFS= read -r dir | |
do | |
mkdir -p "$1/$2/${2}_$3/$dir" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment