Created
April 4, 2023 20:24
-
-
Save nicksteffens/b487c54d66bede9f01a743597d9beff1 to your computer and use it in GitHub Desktop.
Revisions
-
nicksteffens created this gist
Apr 4, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/bash # Set the source and destination directories SRC_DIR="$1" DEST_DIR="$2" # Loop through all SVG files in the source directory for svg_file in "$SRC_DIR"/*.svg do # Get the filename without the path or extension filename=$(basename "$svg_file" .svg) # Prepend the directory name to the filename new_filename="$(basename $SRC_DIR)-$filename.svg" # Copy the file to the destination directory with the new filename cp "$svg_file" "$DEST_DIR/$new_filename" done