Created
November 22, 2023 14:01
-
-
Save andrewmcodes/cda0f307bc1628000b20620e0e3327f0 to your computer and use it in GitHub Desktop.
Add comment to random Ruby file
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
#! /usr/bin/env zsh | |
file=$(fd -e rb -H -1 | shuf -n 1) | |
line=$(shuf -i 1-$(($(wc -l < "$file") + 1)) -n 1) | |
awk -v line="$line" 'NR==line{$0="# GOOD_JOB: YOU PROBABLY FORGOT TO REMOVE THIS COMMENT DIDNT YOU\n"$0}1' "$file" > temp && mv temp "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment