Skip to content

Commit e3ac2df

Browse files
author
Mingcong Bai
committed
last_directory: eradicated.
1 parent 4387e06 commit e3ac2df

File tree

4 files changed

+2
-25
lines changed

4 files changed

+2
-25
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Structure
2323
* Sets up the PS1
2424
* Sets up aliases
2525
* Sets up some bash-specific variables.
26-
* Prepares the `_lastdir` functions for saving last directory on logout.
2726
* `profile` - Environment variables for all POSIX login shells
2827
* Sets up `$PATH` and `$MANPATH`:
2928
* Ignores lines starting with `#`.
@@ -36,9 +35,9 @@ Structure
3635
* Sets up `$TZ` and some common history variables.
3736
* Sources `profile.d`.
3837
* `skel` - `$HOME` Skeleton. Contains what we think is good for most users.
39-
* `.bashrc` - User bash startup, sources `/etc/bashrc`, runs `_lastdir_go`.
38+
* `.bashrc` - User bash startup, sources `/etc/bashrc`.
4039
* `.bash_profile` - User bash login, sources `~/.bashrc`.
41-
* `.bash_logout` - User bash logout, runs `_lastdir_rec`.
40+
* `.bash_logout` - User bash logout.
4241
* `bashrc.d` - Files sourced by `/etc/bashrc`.
4342
* `20-vcs` - VCS aliases and PS1. Provides `_vcs_status`.
4443
* `.vcs_*` - VCS Implementations.

bashrc

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,6 @@ _is_posix || which(){ (alias; declare -F) | /usr/bin/which -i --read-functions "
108108
# Misc stuffs
109109
FIGNORE='~'
110110
TIMEFORMAT=$'\nreal\t%3lR\t%P%%\nuser\t%3lU\nsys\t%3lS'
111-
# Last directory recoding measure.
112-
_lastdir_go() {
113-
if [ -s ~/.last_directory ]; then
114-
if [ -d $(cat ~/.last_directory) ]; then
115-
echo -e "$YELLOW>>>\t${CYAN}Returning you to the last directory...$NORMAL \`$(cat ~/.last_directory)'"
116-
cd $(cat ~/.last_directory)
117-
else
118-
echo -e "$YELLOW>>>\t${CYAN}Last recorded directory cannot be accessed or was already removed.$NORMAL"
119-
fi
120-
fi
121-
}
122-
123-
_lastdir_rec() {
124-
local _ret=$? # Return value transparency is actually important here
125-
echo -ne "$YELLOW>>>\t\033[36mRecording your current working directory...\033[0m"
126-
pwd > ~/.last_directory
127-
return $_ret
128-
}
129111

130112
unset script shopt
131113
# End /etc/bashrc

skel/.bash_logout

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
# Written for Beyond Linux From Scratch
33
# by James Robertson <[email protected]>
44

5-
# Personal items to perform on logout.
6-
_lastdir_rec
75
# End ~/.bash_logout

skel/.bashrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ if [ -f "/etc/bashrc" ] ; then
1313
source /etc/bashrc
1414
fi
1515

16-
# Restores last directory state.
17-
_lastdir_go
1816
# End ~/.bashrc

0 commit comments

Comments
 (0)