Skip to content

Instantly share code, notes, and snippets.

@Akczht
Last active December 30, 2024 22:00
Show Gist options
  • Save Akczht/e7f3b67110ba1a948c4851260e45cd9f to your computer and use it in GitHub Desktop.
Save Akczht/e7f3b67110ba1a948c4851260e45cd9f to your computer and use it in GitHub Desktop.

Revisions

  1. Akczht revised this gist Dec 30, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion subs.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    set -ex
    set -e

    # Directory to process (current directory)
    DIRECTORY="$PWD"
  2. Akczht renamed this gist Dec 30, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Akczht created this gist Dec 24, 2024.
    20 changes: 20 additions & 0 deletions subs.ass
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/bin/bash
    set -ex

    # Directory to process (current directory)
    DIRECTORY="$PWD"

    # Loop through all .ass files in the directory
    for file in "$DIRECTORY"/*.ass; do
    # Check if the file exists (to avoid issues if no .ass files are present)
    if [[ -f "$file" ]]; then
    echo "Processing: $file"
    # Use sed to replace "Arial" with "Remi Script" and save changes in-place
    sed -i '' 's/Arial/Remi Script/g' "$file"
    echo "Updated font in $file"
    else
    echo "No .ass files found in $DIRECTORY."
    fi
    done

    echo "Font replacement completed."