projects
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f23707
)
Update lsn.
author
Francois Fleuret
<francois@fleuret.org>
Wed, 28 Aug 2013 07:22:04 +0000
(09:22 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Wed, 28 Aug 2013 07:22:04 +0000
(09:22 +0200)
bashrc
patch
|
blob
|
history
diff --git
a/bashrc
b/bashrc
index
ad11407
..
1a947db
100644
(file)
--- a/
bashrc
+++ b/
bashrc
@@
-938,17
+938,22
@@
function selector-printer () {
# the current directory
function lsn () {
# the current directory
function lsn () {
- LSN_MEMORY=".lsn-mem"
- if [[ $1 == "--mem" ]]; then
- \ls -p > ${LSN_MEMORY}
+ LSN_MEMORY=".lsn-state"
+ if [[ $1 == "--mem" ]] || [[ "$1" == "-m" ]]; then
+ \ls -pa | sort > ${LSN_MEMORY}
+ echo "State updated." >&2
+ elif [[ -n "$1" ]]; then
+ echo "lsn [--mem|-m]" >&2
+ return 1
else
if [[ -f ${LSN_MEMORY} ]]; then
else
if [[ -f ${LSN_MEMORY} ]]; then
- comm -1 -3 ${LSN_MEMORY} <(\ls -p)
- comm -2 -3 ${LSN_MEMORY} <(\ls -p) | while read line; do
+ comm -1 -3 ${LSN_MEMORY} <(\ls -p
a | sort
)
+ comm -2 -3 ${LSN_MEMORY} <(\ls -p
a | sort
) | while read line; do
echo "${VT_RED_FG}${VT_BOLD}${line}${VT_RESET} (missing)"
done
else
echo "${VT_RED_FG}${VT_BOLD}${line}${VT_RESET} (missing)"
done
else
- echo "No lsn memory here." >&2
+ echo "No lsn state here." >&2
+ return 1
fi
fi
}
fi
fi
}