From 6ca51e58b9c98dbbc5ddd7bda3d2bc794f465bd8 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Thu, 16 Jun 2022 04:42:31 +0200 Subject: [PATCH] sort all reverse-related tags less lazy script but still bash: \#!/bin/bash tag="reverse-related" relationrx="<$tag([^>]*)>([^<]*)" numberrx='[0-9]+' declare -A list # associative array while IFS= read -r line; do if [[ $line =~ $relationrx ]]; then yes=1 name="${BASH_REMATCH[2]}" args="${BASH_REMATCH[1]}" if [[ $args =~ $numberrx ]]; then args="$(printf "%03d" "${BASH_REMATCH[0]}")$args" fi list[ "$name$args"]="$line" keys+=" $name$args" elif [[ $yes ]]; then # LC_ALL=C determines the sort behavior! <<<"${keys:1}" LC_ALL=C sort --ignore-case | while read -r key; do echo "${list[ $key]}" done yes="" list=() keys="" echo "$line" else echo "$line" fi done Decree of Justice Descend upon the Sinful Devout Invocation - Entreat the Angels Empyrial Storm + Entreat the Angels Geist of Saint Traft Invocation of Saint Traft Luminarch Ascension @@ -213,8 +213,8 @@ When Angel of Sanctions enters the battlefield, you may exile target nonland per 4/4 KHM - Great Hall of Starnheim Firja's Retribution + Great Hall of Starnheim Starnheim Unleashed Valkyrie's Sword 1 @@ -421,9 +421,9 @@ Creature tokens you control have flying and vigilance. MMA Bat Whisperer Belfry Spirit - Skeletal Vampire Desecrated Tomb Regal Bloodlord + Skeletal Vampire Timothar, Baron of Bats Timothar, Baron of Bats 1 @@ -1488,13 +1488,13 @@ Cloud Sprite can block only creatures with flying. Briarbridge Tracker Bygone Bishop Byway Courier - Sophina, Spearsage Deserter Confirm Suspicions Confront the Unknown Declaration in Stone Dennick, Pious Apparition Disorder in the Court Drownyard Explorers + Elmar, Ulvenwald Informant Eloise, Nephalia Sleuth Eloise, Nephalia Sleuth Ethereal Investigator @@ -1511,13 +1511,13 @@ Cloud Sprite can block only creatures with flying. Jace's Scrutiny Lonis, Cryptozoologist Magnifying Glass - Elmar, Ulvenwald Informant Ongoing Investigation Press for Answers Root Out Search the Premises Secrets of the Key Secrets of the Key + Sophina, Spearsage Deserter Survive the Night Tamiyo's Journal Thorough Investigation @@ -1542,8 +1542,8 @@ Cloud Sprite can block only creatures with flying. C18 WWK - Stone Idol Trap Ancient Stone Idol + Stone Idol Trap 1 2 @@ -1812,12 +1812,12 @@ At the beginning of your upkeep, sacrifice another creature. If you can't, this 3/3 XLN + Baffling End + Crested Herdcaller Huatli, Warrior Poet Raptor Hatchling Regisaur Alpha Thundering Spineback - Baffling End - Crested Herdcaller 1 2 @@ -2403,12 +2403,12 @@ When Earthshaker Khenra enters the battlefield, target creature with power less Elemental Mastery Mask of Immolation Molten Birth + Scampering Scorcher Seasoned Pyromancer Seasoned Pyromancer - Scampering Scorcher Tempt with Vengeance - Young Pyromancer Tilonalli's Summoner + Young Pyromancer 1 2 @@ -2952,8 +2952,8 @@ This creature's power and toughness are each equal to the number of instant and Elderleaf Mentor Elven Ambush Elven Bow - Elvish Warmaster Elvish Promenade + Elvish Warmaster Exquisite Huntmaster Eyeblight Cullers Flourishing Defenses @@ -3210,8 +3210,8 @@ This creature's power and toughness are each equal to the number of instant and Manifestation Sage Oversimplify Paradox Zone - Serpentine Curve Sequence Engine + Serpentine Curve 1 2 @@ -3362,11 +3362,11 @@ Whenever Glyph Keeper becomes the target of a spell or ability for the first tim 1/1 USG - Metrognome - Metrognome By Gnome Means Gnome-Made Engine Gnomeball Machine + Metrognome + Metrognome 1 2 @@ -3455,8 +3455,8 @@ Whenever Glyph Keeper becomes the target of a spell or ability for the first tim Goblin Rabblemaster Goblin Rally Goblin Traprunner - Goblin Warrens Goblin War Party + Goblin Warrens Goblinslide Hordeling Outburst Hunted Phantasm @@ -3478,8 +3478,8 @@ Whenever Glyph Keeper becomes the target of a spell or ability for the first tim Sling-Gang Lieutenant Survey the Wreckage Swarming Goblins - You See a Pair of Goblins Warbreak Trumpeter + You See a Pair of Goblins 1 2 @@ -3954,8 +3954,8 @@ At the beginning of your upkeep, this creature deals 1 damage to you. 2/2 ISD - Stitcher's Apprentice Handy Dandy Clone Machine + Stitcher's Apprentice 1 2 @@ -5240,8 +5240,8 @@ Flying, vigilance, trample, lifelink, haste 1/1 XLN - Deeproot Waters Aquatic Incursion + Deeproot Waters Jungleborn Pioneer 1 2 @@ -6677,6 +6677,8 @@ Equip {1} Fertile Imagination Fists of Ironwood Flash Foliage + Fungal Infection + Fungal Plots Fungal Rebirth Fungal Sprouting Ghave, Guru of Spores @@ -6693,6 +6695,7 @@ Equip {1} Necrogenesis Nemata, Grove Guardian Night Soil + Overgrown Armasaur Pallid Mycoderm Pollenbright Wings Psychotrope Thallid @@ -6701,14 +6704,18 @@ Equip {1} Roots of All Evil Saproling Cluster Saproling Infestation + Saproling Migration + Saproling Migration Saproling Symbiosis Savage Thallid Scatter the Seeds Seed Spark Selesnya Evangel Selesnya Guildmage + Slimefoot, the Stowaway Spontaneous Generation Spore Burst + Spore Swarm Sporemound Sporesower Thallid Sporeweb Weaver @@ -6719,6 +6726,7 @@ Equip {1} Sprouting Thrinax Supply // Demand Tana, the Bloodsower + Tendershoot Dryad Thallid Thallid Devourer Thallid Germinator @@ -6726,21 +6734,13 @@ Equip {1} Thelonite Hermit Tukatongue Thallid Ulasht, the Hate Seed + Undercellar Myconid Utopia Mycon Verdant Embrace Verdant Force Verdeloth the Ancient Vitaspore Thallid Vitu-Ghazi, the City-Tree - Overgrown Armasaur - Tendershoot Dryad - Fungal Infection - Fungal Plots - Saproling Migration - Saproling Migration - Slimefoot, the Stowaway - Spore Swarm - Undercellar Myconid Yavimaya Sapherd 1 2 @@ -6860,15 +6860,15 @@ Equip {1} Peema Outrider Propeller Pioneer Renegade's Getaway + Retrofitter Foundry + Saheeli, Sublime Artificer + Saheeli, the Gifted Servo Exhibition Servo Schematic Sly Requisitioner Sram's Expertise Visionary Augmenter Weaponcraft Enthusiast - Retrofitter Foundry - Saheeli, Sublime Artificer - Saheeli, the Gifted 1 2 @@ -7512,11 +7512,11 @@ At the beginning of the end step, sacrifice Spark Elemental. SHM Arachnogenesis Arasta of the Endless Web + Brood Weaver Curse of Clinging Webs Curse of Clinging Webs Gloomwidow's Feast Ishkanah, Grafwidow - Brood Weaver Rotwidow Pack Spider Spawning Twin-Silk Spider @@ -7630,10 +7630,10 @@ At the beginning of the end step, sacrifice Spark Elemental. Alharu, Solemn Ritualist Avacyn's Collar Benevolent Offering - Blessed Defiance Bishop of Wings - Brinebound Gift + Blessed Defiance Brine Comber + Brinebound Gift Clarion Spirit Court of Grace Custodi Soulbinders @@ -7653,8 +7653,8 @@ At the beginning of the end step, sacrifice Spark Elemental. Haunted Library Haunted Library Heron-Blessed Geist - Kaya, Geist Hunter Kaya the Inexorable + Kaya, Geist Hunter Kirtar's Wrath Kykar, Wind's Fury Lingering Souls @@ -7761,8 +7761,8 @@ At the beginning of the end step, sacrifice Spark Elemental. Concord with the Kami Dripping-Tongue Zubera Forbidden Orchard - Gods' Eye, Gate to the Reikai Go-Shintai of Shared Purpose + Gods' Eye, Gate to the Reikai Honden of Life's Web Kirin-Touched Orochi Myojin of Blooming Dawn @@ -8253,8 +8253,8 @@ This creature can't be enchanted. Inspired Sphinx Loyal Apprentice Maverick Thopterist - Pia Nalaar Pia and Kiran Nalaar + Pia Nalaar Retrofitter Foundry Sai, Master Thopterist Sweep the Skies @@ -8794,12 +8794,12 @@ Sacrifice this creature: This creature deals 1 damage to target creature or play XLN Adanto, the First Fort Call to the Feast + Elenda, the Dusk Rose Legion's Landing + Martyr of Dusk Mavren Fein, Dusk Apostle Paladin of the Bloodstained Queen's Commission - Elenda, the Dusk Rose - Martyr of Dusk Squire's Devotion 1 2 @@ -9057,14 +9057,14 @@ Whenever you cast a creature spell, note one of its creature types that hasn't b DTK KTK KTK + Blaring Recruiter Herald of Anafenza Mardu Charm Mardu Hordechief - Secure the Wastes - Take Up Arms - Blaring Recruiter Najeela, the Blade-Blossom Regna, the Redeemer + Secure the Wastes + Take Up Arms 1 2 @@ -9226,8 +9226,8 @@ Whenever you cast a creature spell, note one of its creature types that hasn't b SHM LRW Arlinn Kord - Arlinn, Voice of the Pack Arlinn, the Pack's Hope + Arlinn, Voice of the Pack Bestial Menace Child of the Pack Cult of the Waxing Moon @@ -9550,8 +9550,8 @@ Whenever you cast a creature spell, note one of its creature types that hasn't b Endless Ranks of the Dead Feast or Famine Field of the Dead - From Under the Floorboards From Under the Floorboards + From Under the Floorboards Ghoulcaller Gisa Ghoulcaller's Accomplice Gisa's Bidding @@ -11151,8 +11151,8 @@ If a player casts no spells during their own turn, it becomes night next turn.Tavern Ruffian The Celestus Tireless Hauler - Tovolar, Dire Overlord Tovolar's Huntmaster + Tovolar, Dire Overlord Vadrik, Astral Archmage Village Watch 1 @@ -11284,10 +11284,10 @@ Whenever a creature deals combat damage to you, its controller becomes the monar Dawnglade Regent Emberwilde Captain Entourage of Trest - Garrulous Sycophant Fall from Favor Feast of Succession Garrulous Sycophant + Garrulous Sycophant Jared Carthalion, True Heir Keeper of Keys Knights of the Black Rose