aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cdlog.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/cdlog.sh b/cdlog.sh
index 1b061fb..e5a6aae 100644
--- a/cdlog.sh
+++ b/cdlog.sh
@@ -157,6 +157,7 @@ cdlog.chdir()
{
local cur=$PWD
local def
+ local print=
declare -n d=cdlog_hist
if [ $# -eq 2 -a "$1" = -P ] ; then
@@ -165,11 +166,13 @@ cdlog.chdir()
;;
( [1-9] )
set -- -P "${d[$2]}"
+ print=y
;;
( ?* )
def=${cdlog_alias[$2]}
if [ -n "$def" ] ; then
- set -- -P "$def"
+ set -- -P "$def"
+ print=y
fi
;;
( * )
@@ -181,6 +184,7 @@ cdlog.chdir()
if command cd "$@" && [ "$PWD" != "$cur" ]; then
# only if we successfully change to a different
# directory do the following
+ [ $print ] && printf "%s\n" "$PWD"
if [ $cdlog_lru ] ; then
local nx=