Created
August 8, 2014 07:15
-
-
Save takac/ec832993cc695a14a519 to your computer and use it in GitHub Desktop.
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
f() | |
{ | |
LAST=$(fc -l | tail -1 | sed 's/^\s*[0-9]\+\s\+//') | |
CMMD=${LAST%% *} | |
if [[ ${CMMD} == "mkdir" ]]; then | |
cd "${LAST#* }" | |
elif [[ ${CMDD} == "cd" ]]; then | |
cd - | |
elif [[ ${CMDD} == "fish" ]]; then | |
cd - | |
else | |
echo "PART 1 is ${LAST[1]}" | |
echo "PART 2 is ${LAST[2]}" | |
echo "CMMD is ${CMMD}" | |
echo "LAST is ${LAST}" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment