<commit_before><commit_msg>added j.sh<commit_after>#!/usr/bin/bash

# A small tool to quickly jump between directories

JFILE=~/.jfile

declare -A J
source $JFILE

function j(){

  case "$1" in
    # add directory entry
    -a)
        J[$2]=`pwd`
        ;;

    # delete directory entry
    -d)
        unset J[$2]
        ;;

    # list all entries
    -l)
        for jk in "${!J[@]}"; do
          echo "J[\"${jk}\"]=\"${J[$jk]}\""
        done
        ;;

    # persist changes
    -s)
        echo "" > $JFILE
        for jk in "${!J[@]}"; do
          echo "J[\"${jk}\"]=\"${J[$jk]}\"" >> $JFILE
        done
        ;;

    # reload entries
    -r)
        source $JFILE
        ;;

    # by default jump
    *)
        cd "${J[$1]}"
        ;;
  esac
}

{'fraction_non_alphanumeric': 0.19003931847968544, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 1.4645161290322581, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2283876', 'n_tokens_mistral': 288, 'n_tokens_neox': 268, 'n_words': 69}