Created
June 18, 2024 08:25
-
-
Save mihsamusev/c7bf68385a0a42f175e92dfaf8f66fff to your computer and use it in GitHub Desktop.
Set 2 folder paths for easy diffs
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
alias lsf='f() { find "$1" -maxdepth 1 -type d | nl -w 2 -s ": "; }; f' | |
set-before() { | |
root=$1 | |
row=$2 | |
BEFORE=$(pwd)/$(lsf "$root" | awk -v n="$row" 'NR==n {print $2}') | |
export BEFORE | |
echo "BEFORE set to $BEFORE" | |
} | |
set-after() { | |
root=$1 | |
row=$2 | |
AFTER=$(pwd)/$(lsf "$root" | awk -v n="$row" 'NR==n {print $2}') | |
export AFTER | |
echo "AFTER set to $AFTER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment