Skip to content

Instantly share code, notes, and snippets.

@mihsamusev
Created June 18, 2024 08:25
Show Gist options
  • Save mihsamusev/c7bf68385a0a42f175e92dfaf8f66fff to your computer and use it in GitHub Desktop.
Save mihsamusev/c7bf68385a0a42f175e92dfaf8f66fff to your computer and use it in GitHub Desktop.
Set 2 folder paths for easy diffs
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