slitaz-base-files rev 213

/etc/profile: add pushd/popd/dirs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 19 16:42:10 2013 +0100 (2013-02-19)
parents bfe80e041c4c
children 9878c3c77ff9
files COPYING rootfs/etc/profile
line diff
     1.1 --- a/COPYING	Mon Jan 28 02:17:46 2013 -0200
     1.2 +++ b/COPYING	Tue Feb 19 16:42:10 2013 +0100
     1.3 @@ -2,7 +2,7 @@
     1.4  ===============================================================================
     1.5  
     1.6  
     1.7 -Copyright (c)  2007-2012  SliTaz GNU/Linux
     1.8 +Copyright (c)  2007-2013  SliTaz GNU/Linux
     1.9  
    1.10  
    1.11  Franšais
     2.1 --- a/rootfs/etc/profile	Mon Jan 28 02:17:46 2013 -0200
     2.2 +++ b/rootfs/etc/profile	Tue Feb 19 16:42:10 2013 +0100
     2.3 @@ -45,3 +45,18 @@
     2.4  case "$TERM" in
     2.5  xterm*|rxvt*) echo -ne "\033]0;$(hostname) $(cat /etc/slitaz-release) $ip\007";;
     2.6  esac
     2.7 +
     2.8 +dirs()
     2.9 +{
    2.10 +	echo $_dirs
    2.11 +}
    2.12 +
    2.13 +pushd()
    2.14 +{
    2.15 +	cd $1 && _dirs="$1 $_dirs" && dirs
    2.16 +}
    2.17 +
    2.18 +popd()
    2.19 +{
    2.20 +	[ -n "$_dirs" ] && _dirs="${_dirs#* }" && cd ${_dirs%% *} && dirs
    2.21 +}