Created
January 23, 2025 23:33
-
-
Save jotafeldmann/31a42df6941453d05fc50ea0f1ecff8d to your computer and use it in GitHub Desktop.
save-path.sh
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
# . save-path.sh | |
# . save-path.sh save | |
SAVE_PATH_FILE=$1 | |
OPTION=$2 | |
if [ "$OPTION" = "save" ]; then | |
echo $PWD > $SAVE_PATH_FILE | |
elif [ "$OPTION" = "create" ]; then | |
touch $SAVE_PATH_FILE | |
elif [ "$OPTION" = "last" ]; then | |
cat $SAVE_PATH_FILE | |
elif [ "$OPTION" = "config" ]; then | |
echo $SAVE_PATH_FILE | |
else | |
cd $(cat $SAVE_PATH_FILE) | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment