head 1.10; access; symbols netbsd-10-2-RELEASE:1.8 netbsd-9-5-RELEASE:1.8 netbsd-11-0-RELEASE:1.10 netbsd-11-0-RC7:1.10 netbsd-11-0-RC6:1.10 netbsd-11-0-RC5:1.10 netbsd-11-0-RC4:1.10 netbsd-11-0-RC3:1.10 netbsd-11-0-RC2:1.10 netbsd-11-0-RC1:1.10 perseant-exfatfs-base-20250801:1.10 netbsd-11:1.10.0.2 netbsd-11-base:1.10 netbsd-10-1-RELEASE:1.8 perseant-exfatfs-base-20240630:1.9 perseant-exfatfs:1.9.0.2 perseant-exfatfs-base:1.9 netbsd-8-3-RELEASE:1.8 netbsd-9-4-RELEASE:1.8 netbsd-10-0-RELEASE:1.8 netbsd-10-0-RC6:1.8 netbsd-10-0-RC5:1.8 netbsd-10-0-RC4:1.8 netbsd-10-0-RC3:1.8 netbsd-10-0-RC2:1.8 netbsd-10-0-RC1:1.8 netbsd-10:1.8.0.26 netbsd-10-base:1.8 netbsd-9-3-RELEASE:1.8 cjep_sun2x-base1:1.8 cjep_sun2x:1.8.0.24 cjep_sun2x-base:1.8 cjep_staticlib_x-base1:1.8 netbsd-9-2-RELEASE:1.8 cjep_staticlib_x:1.8.0.22 cjep_staticlib_x-base:1.8 netbsd-9-1-RELEASE:1.8 phil-wifi-20200421:1.8 phil-wifi-20200411:1.8 is-mlppp:1.8.0.20 is-mlppp-base:1.8 phil-wifi-20200406:1.8 netbsd-8-2-RELEASE:1.8 netbsd-9-0-RELEASE:1.8 netbsd-9-0-RC2:1.8 netbsd-9-0-RC1:1.8 phil-wifi-20191119:1.8 netbsd-9:1.8.0.18 netbsd-9-base:1.8 phil-wifi-20190609:1.8 netbsd-8-1-RELEASE:1.8 netbsd-8-1-RC1:1.8 pgoyette-compat-merge-20190127:1.8 pgoyette-compat-20190127:1.8 pgoyette-compat-20190118:1.8 pgoyette-compat-1226:1.8 pgoyette-compat-1126:1.8 pgoyette-compat-1020:1.8 pgoyette-compat-0930:1.8 pgoyette-compat-0906:1.8 netbsd-7-2-RELEASE:1.7 pgoyette-compat-0728:1.8 netbsd-8-0-RELEASE:1.8 phil-wifi:1.8.0.16 phil-wifi-base:1.8 pgoyette-compat-0625:1.8 netbsd-8-0-RC2:1.8 pgoyette-compat-0521:1.8 pgoyette-compat-0502:1.8 pgoyette-compat-0422:1.8 netbsd-8-0-RC1:1.8 pgoyette-compat-0415:1.8 pgoyette-compat-0407:1.8 pgoyette-compat-0330:1.8 pgoyette-compat-0322:1.8 pgoyette-compat-0315:1.8 netbsd-7-1-2-RELEASE:1.7 pgoyette-compat:1.8.0.14 pgoyette-compat-base:1.8 netbsd-7-1-1-RELEASE:1.7 matt-nb8-mediatek:1.8.0.12 matt-nb8-mediatek-base:1.8 perseant-stdc-iso10646:1.8.0.10 perseant-stdc-iso10646-base:1.8 netbsd-8:1.8.0.8 netbsd-8-base:1.8 prg-localcount2-base3:1.8 prg-localcount2-base2:1.8 prg-localcount2-base1:1.8 prg-localcount2:1.8.0.6 prg-localcount2-base:1.8 pgoyette-localcount-20170426:1.8 bouyer-socketcan-base1:1.8 pgoyette-localcount-20170320:1.8 netbsd-7-1:1.7.0.102 netbsd-7-1-RELEASE:1.7 netbsd-7-1-RC2:1.7 netbsd-7-nhusb-base-20170116:1.7 bouyer-socketcan:1.8.0.4 bouyer-socketcan-base:1.8 pgoyette-localcount-20170107:1.8 netbsd-7-1-RC1:1.7 pgoyette-localcount-20161104:1.8 netbsd-7-0-2-RELEASE:1.7 localcount-20160914:1.8 netbsd-7-nhusb:1.7.0.100 netbsd-7-nhusb-base:1.7 pgoyette-localcount-20160806:1.8 pgoyette-localcount-20160726:1.8 pgoyette-localcount:1.8.0.2 pgoyette-localcount-base:1.8 netbsd-7-0-1-RELEASE:1.7 netbsd-7-0:1.7.0.98 netbsd-7-0-RELEASE:1.7 netbsd-7-0-RC3:1.7 netbsd-7-0-RC2:1.7 netbsd-7-0-RC1:1.7 netbsd-5-2-3-RELEASE:1.7 netbsd-5-1-5-RELEASE:1.7 netbsd-6-0-6-RELEASE:1.7 netbsd-6-1-5-RELEASE:1.7 netbsd-7:1.7.0.96 netbsd-7-base:1.7 yamt-pagecache-base9:1.7 yamt-pagecache-tag8:1.7 netbsd-6-1-4-RELEASE:1.7 netbsd-6-0-5-RELEASE:1.7 tls-earlyentropy:1.7.0.94 tls-earlyentropy-base:1.7 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.7 riastradh-drm2-base3:1.7 netbsd-6-1-3-RELEASE:1.7 netbsd-6-0-4-RELEASE:1.7 netbsd-5-2-2-RELEASE:1.7 netbsd-5-1-4-RELEASE:1.7 netbsd-6-1-2-RELEASE:1.7 netbsd-6-0-3-RELEASE:1.7 netbsd-5-2-1-RELEASE:1.7 netbsd-5-1-3-RELEASE:1.7 netbsd-6-1-1-RELEASE:1.7 riastradh-drm2-base2:1.7 riastradh-drm2-base1:1.7 riastradh-drm2:1.7.0.86 riastradh-drm2-base:1.7 netbsd-6-1:1.7.0.92 netbsd-6-0-2-RELEASE:1.7 netbsd-6-1-RELEASE:1.7 khorben-n900:1.7.0.90 netbsd-6-1-RC4:1.7 netbsd-6-1-RC3:1.7 agc-symver:1.7.0.88 agc-symver-base:1.7 netbsd-6-1-RC2:1.7 netbsd-6-1-RC1:1.7 yamt-pagecache-base8:1.7 netbsd-5-2:1.7.0.84 netbsd-6-0-1-RELEASE:1.7 yamt-pagecache-base7:1.7 netbsd-5-2-RELEASE:1.7 netbsd-5-2-RC1:1.7 matt-nb6-plus-nbase:1.7 yamt-pagecache-base6:1.7 netbsd-6-0:1.7.0.82 netbsd-6-0-RELEASE:1.7 netbsd-6-0-RC2:1.7 tls-maxphys:1.7.0.80 tls-maxphys-base:1.7 matt-nb6-plus:1.7.0.78 matt-nb6-plus-base:1.7 netbsd-6-0-RC1:1.7 yamt-pagecache-base5:1.7 yamt-pagecache-base4:1.7 netbsd-6:1.7.0.76 netbsd-6-base:1.7 netbsd-5-1-2-RELEASE:1.7 netbsd-5-1-1-RELEASE:1.7 yamt-pagecache-base3:1.7 yamt-pagecache-base2:1.7 yamt-pagecache:1.7.0.74 yamt-pagecache-base:1.7 cherry-xenmp:1.7.0.72 cherry-xenmp-base:1.7 bouyer-quota2-nbase:1.7 bouyer-quota2:1.7.0.70 bouyer-quota2-base:1.7 matt-mips64-premerge-20101231:1.7 matt-nb5-mips64-premerge-20101231:1.7 matt-nb5-pq3:1.7.0.68 matt-nb5-pq3-base:1.7 netbsd-5-1:1.7.0.66 netbsd-5-1-RELEASE:1.7 netbsd-5-1-RC4:1.7 matt-nb5-mips64-k15:1.7 netbsd-5-1-RC3:1.7 netbsd-5-1-RC2:1.7 netbsd-5-1-RC1:1.7 netbsd-5-0-2-RELEASE:1.7 matt-nb5-mips64-premerge-20091211:1.7 matt-premerge-20091211:1.7 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.7 matt-nb4-mips64-k7-u2a-k9b:1.7 matt-nb5-mips64-u1-k1-k5:1.7 matt-nb5-mips64:1.7.0.64 netbsd-5-0-1-RELEASE:1.7 jym-xensuspend-nbase:1.7 netbsd-5-0:1.7.0.62 netbsd-5-0-RELEASE:1.7 netbsd-5-0-RC4:1.7 netbsd-5-0-RC3:1.7 netbsd-5-0-RC2:1.7 jym-xensuspend:1.7.0.60 jym-xensuspend-base:1.7 netbsd-5-0-RC1:1.7 netbsd-5:1.7.0.58 netbsd-5-base:1.7 matt-mips64-base2:1.7 matt-mips64:1.7.0.56 mjf-devfs2:1.7.0.54 mjf-devfs2-base:1.7 netbsd-4-0-1-RELEASE:1.7 wrstuden-revivesa-base-3:1.7 wrstuden-revivesa-base-2:1.7 wrstuden-fixsa-newbase:1.7 wrstuden-revivesa-base-1:1.7 yamt-pf42-base4:1.7 yamt-pf42-base3:1.7 hpcarm-cleanup-nbase:1.7 yamt-pf42-baseX:1.7 yamt-pf42-base2:1.7 wrstuden-revivesa:1.7.0.52 wrstuden-revivesa-base:1.7 yamt-pf42:1.7.0.50 yamt-pf42-base:1.7 keiichi-mipv6:1.7.0.48 keiichi-mipv6-base:1.7 matt-armv6-nbase:1.7 matt-armv6-prevmlocking:1.7 wrstuden-fixsa-base-1:1.7 netbsd-4-0:1.7.0.46 netbsd-4-0-RELEASE:1.7 cube-autoconf:1.7.0.44 cube-autoconf-base:1.7 netbsd-4-0-RC5:1.7 netbsd-4-0-RC4:1.7 netbsd-4-0-RC3:1.7 netbsd-4-0-RC2:1.7 netbsd-4-0-RC1:1.7 matt-armv6:1.7.0.42 matt-armv6-base:1.7 matt-mips64-base:1.7 hpcarm-cleanup:1.7.0.40 hpcarm-cleanup-base:1.7 netbsd-3-1-1-RELEASE:1.7 netbsd-3-0-3-RELEASE:1.7 wrstuden-fixsa:1.7.0.38 wrstuden-fixsa-base:1.7 abandoned-netbsd-4-base:1.7 abandoned-netbsd-4:1.7.0.32 netbsd-3-1:1.7.0.34 netbsd-3-1-RELEASE:1.7 netbsd-3-0-2-RELEASE:1.7 netbsd-3-1-RC4:1.7 netbsd-3-1-RC3:1.7 netbsd-3-1-RC2:1.7 netbsd-3-1-RC1:1.7 netbsd-4:1.7.0.36 netbsd-4-base:1.7 netbsd-3-0-1-RELEASE:1.7 netbsd-3-0:1.7.0.30 netbsd-3-0-RELEASE:1.7 netbsd-3-0-RC6:1.7 netbsd-3-0-RC5:1.7 netbsd-3-0-RC4:1.7 netbsd-3-0-RC3:1.7 netbsd-3-0-RC2:1.7 netbsd-3-0-RC1:1.7 netbsd-2-0-3-RELEASE:1.7 netbsd-2-1:1.7.0.28 netbsd-2-1-RELEASE:1.7 netbsd-2-1-RC6:1.7 netbsd-2-1-RC5:1.7 netbsd-2-1-RC4:1.7 netbsd-2-1-RC3:1.7 netbsd-2-1-RC2:1.7 netbsd-2-1-RC1:1.7 netbsd-2-0-2-RELEASE:1.7 netbsd-3:1.7.0.26 netbsd-3-base:1.7 netbsd-2-0-1-RELEASE:1.7 netbsd-2:1.7.0.24 netbsd-2-base:1.7 netbsd-2-0-RELEASE:1.7 netbsd-2-0-RC5:1.7 netbsd-2-0-RC4:1.7 netbsd-2-0-RC3:1.7 netbsd-2-0-RC2:1.7 netbsd-2-0-RC1:1.7 netbsd-2-0:1.7.0.22 netbsd-2-0-base:1.7 netbsd-1-6-PATCH002-RELEASE:1.7 netbsd-1-6-PATCH002:1.7 netbsd-1-6-PATCH002-RC4:1.7 netbsd-1-6-PATCH002-RC3:1.7 netbsd-1-6-PATCH002-RC2:1.7 netbsd-1-6-PATCH002-RC1:1.7 netbsd-1-6-PATCH001:1.7 netbsd-1-6-PATCH001-RELEASE:1.7 netbsd-1-6-PATCH001-RC3:1.7 netbsd-1-6-PATCH001-RC2:1.7 netbsd-1-6-PATCH001-RC1:1.7 fvdl_fs64_base:1.7 netbsd-1-6-RELEASE:1.7 netbsd-1-6-RC3:1.7 netbsd-1-6-RC2:1.7 netbsd-1-6-RC1:1.7 netbsd-1-6:1.7.0.20 netbsd-1-6-base:1.7 netbsd-1-5-PATCH003:1.7 ELRICshvfork:1.7.0.18 ELRICshvfork-base:1.7 netbsd-1-5-PATCH002:1.7 netbsd-1-5-PATCH001:1.7 netbsd-1-5-RELEASE:1.7 netbsd-1-5-BETA2:1.7 netbsd-1-5-BETA:1.7 netbsd-1-4-PATCH003:1.7 netbsd-1-5-ALPHA2:1.7 netbsd-1-5:1.7.0.16 netbsd-1-5-base:1.7 minoura-xpg4dl:1.7.0.14 minoura-xpg4dl-base:1.7 netbsd-1-4-PATCH002:1.7 wrstuden-devbsize-19991221:1.7 wrstuden-devbsize:1.7.0.12 wrstuden-devbsize-base:1.7 comdex-fall-1999:1.7.0.10 comdex-fall-1999-base:1.7 netbsd-1-4-PATCH001:1.7 netbsd-1-4-RELEASE:1.7 netbsd-1-4:1.7.0.8 netbsd-1-4-base:1.7 netbsd-1-3-PATCH003:1.7 netbsd-1-3-PATCH003-CANDIDATE2:1.7 netbsd-1-3-PATCH003-CANDIDATE1:1.7 netbsd-1-3-PATCH003-CANDIDATE0:1.7 netbsd-1-3-PATCH002:1.7 netbsd-1-3-PATCH001:1.7 netbsd-1-3-RELEASE:1.7 netbsd-1-3-BETA:1.7 netbsd-1-3:1.7.0.4 netbsd-1-3-base:1.7 netbsd-1-2-PATCH001:1.7 netbsd-1-2-RELEASE:1.7 netbsd-1-2-BETA:1.7 netbsd-1-2-base:1.7 netbsd-1-2:1.7.0.6 netbsd-1-1-PATCH001:1.7 netbsd-1-1-RELEASE:1.7 netbsd-1-1:1.7.0.2 netbsd-1-1-base:1.7 netbsd-1-0-PATCH06:1.5 netbsd-1-0-PATCH05:1.5 netbsd-1-0-PATCH04:1.5 netbsd-1-0-PATCH03:1.5 netbsd-1-0-PATCH02:1.5 netbsd-1-0-PATCH1:1.5 netbsd-1-0-PATCH0:1.5 netbsd-1-0-RELEASE:1.5 netbsd-1-0:1.5.0.2 netbsd-1-0-base:1.5 lite-1:1.1.1.2 CSRG:1.1.1 netbsd-0-9-RELEASE:1.3 netbsd-0-9-BETA:1.3 netbsd-0-9-ALPHA2:1.3 netbsd-0-9-ALPHA:1.3 netbsd-0-9:1.3.0.2 netbsd-0-9-base:1.3 netbsd-0-8:1.3 netbsd-alpha-1:1.3 patchkit-0-2-2:1.1.1.1 WFJ-386bsd-01:1.1.1.1 WFJ-920714:1.1.1; locks; strict; comment @# @; 1.10 date 2025.04.09.13.44.12; author kre; state Exp; branches; next 1.9; commitid Oj0yU2Y0FPV4GnQF; 1.9 date 2023.04.07.10.34.13; author kre; state Exp; branches 1.9.2.1; next 1.8; commitid 8FpW2wyuWp9nbakE; 1.8 date 2016.02.29.23.50.59; author christos; state Exp; branches 1.8.16.1; next 1.7; commitid uier6k4RljFAYRWy; 1.7 date 95.05.11.21.31.08; author christos; state Exp; branches; next 1.6; 1.6 date 95.03.21.09.10.54; author cgd; state Exp; branches; next 1.5; 1.5 date 94.06.11.16.12.46; author mycroft; state Exp; branches; next 1.4; 1.4 date 94.05.11.17.10.58; author jtc; state Exp; branches; next 1.3; 1.3 date 93.03.23.00.29.47; author cgd; state Exp; branches; next 1.2; 1.2 date 93.03.22.08.04.00; author cgd; state Exp; branches; next 1.1; 1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches 1.1.1.1; next ; 1.9.2.1 date 2025.08.02.05.18.27; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; 1.8.16.1 date 2020.04.21.18.41.07; author martin; state dead; branches; next 1.8.16.2; commitid 86tA4aEmdr3VCh5C; 1.8.16.2 date 2020.04.21.19.37.35; author martin; state Exp; branches; next ; commitid x6IB64bYH9UmWh5C; 1.1.1.1 date 93.03.21.09.45.37; author cgd; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 94.05.11.17.03.15; author jtc; state Exp; branches; next ; desc @@ 1.10 log @Modernise these (unused) functions Much of what is here is truly ancient. It isn't used as part of the build (never installed anywhere) so are only available from src/bin/sh/funcs which means that in practice no-one ever sees or uses any of this. A notable example is the provided 'suspend' function, which has been using "set +j" to turn off job control all this time. That was the old (original ash) name for what is now the 'm' option ... it was changed (by Berkeley CSRG) in July 1992 (approaching 33 years ago), which means the suspend function provided here hasn't been used in at least 33 years. (Since "suspend" is now provided as a sh builtin, the function here is no real use anyway). Still, since they exist here, they may as well be made to work properly. Note: should anyone decide to install these somewhere, the "pushd" "popd" and "dirs" scripts are all the same thing, and (while they could be installed as 3 files) should really be just one file, linked to 3 names, when installed - it makes no practical difference which of them gets copied rather than just being a link. @ text @# $NetBSD: dirs,v 1.9 2023/04/07 10:34:13 kre Exp $ # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. # # This code is derived from software contributed to Berkeley by # Kenneth Almquist. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # @@(#)dirs 8.2 (Berkeley) 5/4/95 # pushd, popd, and dirs --- written by Chris Bertin # Pixel Computer Inc. ...!wjh12!pixel!pixutl!chris # as modified by Patrick Elam of GTRI and Kenneth Almquist at UW # produce decidely sub-optimal quoting, but adequate for the purpose __ds_quote() { local A QA PP case "$1" in -z) DSTACK=;& # zero, then... -a) PP=false;; # append (retain arg order) -r) DSTACK=;& # zero, then... -p) PP=true;; # prepend (reverse arg order) *) printf '__ds_quote usage error\n' >&2; return 1;; esac shift for A do QA= while case "${A}" in \'?*) QA="${QA}'\\''" A=${A#?} ;; ?*\'?*) QA="${QA}${A%%\'*}" A=\'${A#*\'} ;; *\') QA="${QA}'\\" A= ;& *) false ;; esac do continue done if "${PP}" then DSTACK="'${QA}${A}'${DSTACK:+ }${DSTACK}" else DSTACK="${DSTACK}${DSTACK:+ }'${QA}${A}'" fi done return 0 } pushd () { local IFS=' ' SAVE SAVE=${PWD} if [ "$#" = 0 ] then if [ "${#DSTACK}" = 0 ] then printf 'pushd: directory stack empty.\n' >&2 return 1 fi eval set -- ${DSTACK} cd -P ${1:+"$1"} || return shift __ds_quote -z "$@@" || return else cd -P ${1:+"$1"} > /dev/null || return fi __ds_quote -p "${SAVE}" || return dirs } popd () { local IFS=' ' if [ "${#DSTACK}" = 0 ] then printf 'popd: directory stack empty.\n' >&2 return 1 fi eval set -- ${DSTACK} cd -P ${1:+"$1"} shift __ds_quote -z "$@@" || return dirs } dirs () { local IFS=' ' printf %s "${PWD}" eval set -- ${DSTACK} test "$#" != 0 && printf " %s" "$@@" printf \\n return 0 } @ 1.9 log @ The great shell trailing whitespace cleanup of 2023... Inspired by private e-mail comments from mouse@@ NFCI. @ text @d1 1 a1 1 # $NetBSD: dirs,v 1.8 2016/02/29 23:50:59 christos Exp $ d35 49 d85 8 a92 4 SAVE=`pwd` if [ "$1" = "" ] then if [ "$DSTACK" = "" ] then echo "pushd: directory stack empty." d95 6 a100 5 set $DSTACK cd $1 || return shift 1 DSTACK="$*" else cd $1 > /dev/null || return d102 3 a104 1 DSTACK="$SAVE $DSTACK" d109 5 a113 2 if [ "$DSTACK" = "" ] then echo "popd: directory stack empty." d116 2 a117 2 set $DSTACK cd $1 d119 1 a119 1 DSTACK=$* d124 6 a129 1 echo "`pwd` $DSTACK" @ 1.9.2.1 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: dirs,v 1.10 2025/04/09 13:44:12 kre Exp $ a34 49 # produce decidely sub-optimal quoting, but adequate for the purpose __ds_quote() { local A QA PP case "$1" in -z) DSTACK=;& # zero, then... -a) PP=false;; # append (retain arg order) -r) DSTACK=;& # zero, then... -p) PP=true;; # prepend (reverse arg order) *) printf '__ds_quote usage error\n' >&2; return 1;; esac shift for A do QA= while case "${A}" in \'?*) QA="${QA}'\\''" A=${A#?} ;; ?*\'?*) QA="${QA}${A%%\'*}" A=\'${A#*\'} ;; *\') QA="${QA}'\\" A= ;& *) false ;; esac do continue done if "${PP}" then DSTACK="'${QA}${A}'${DSTACK:+ }${DSTACK}" else DSTACK="${DSTACK}${DSTACK:+ }'${QA}${A}'" fi done return 0 } d36 4 a39 8 local IFS=' ' SAVE SAVE=${PWD} if [ "$#" = 0 ] then if [ "${#DSTACK}" = 0 ] then printf 'pushd: directory stack empty.\n' >&2 d42 5 a46 6 eval set -- ${DSTACK} cd -P ${1:+"$1"} || return shift __ds_quote -z "$@@" || return else cd -P ${1:+"$1"} > /dev/null || return d48 1 a48 3 __ds_quote -p "${SAVE}" || return d53 2 a54 5 local IFS=' ' if [ "${#DSTACK}" = 0 ] then printf 'popd: directory stack empty.\n' >&2 d57 2 a58 2 eval set -- ${DSTACK} cd -P ${1:+"$1"} d60 1 a60 1 __ds_quote -z "$@@" || return d65 1 a65 6 local IFS=' ' printf %s "${PWD}" eval set -- ${DSTACK} test "$#" != 0 && printf " %s" "$@@" printf \\n @ 1.8 log @delete clauses 3,4 @ text @d1 1 a1 1 # $NetBSD: dirs,v 1.7 1995/05/11 21:31:08 christos Exp $ d37 1 a37 1 if [ "$1" = "" ] d53 1 a53 1 if [ "$DSTACK" = "" ] @ 1.8.16.1 log @Sync with HEAD @ text @d1 1 a1 1 # $NetBSD: dirs,v 1.8 2016/02/29 23:50:59 christos Exp $ @ 1.8.16.2 log @Ooops, restore accidently removed files from merge mishap @ text @@ 1.7 log @Merge in my changes from vangogh, and fix the x=`false`; echo $? == 0 bug. @ text @d1 1 a1 1 # $NetBSD$ a15 7 # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by the University of # California, Berkeley and its contributors. # 4. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. @ 1.6 log @convert to new RCS id conventions. @ text @a1 1 # d36 1 a36 1 # @@(#)dirs 8.1 (Berkeley) 5/31/93 @ 1.5 log @Add RCS ids. @ text @d1 2 d37 1 a37 2 # from: @@(#)dirs 8.1 (Berkeley) 5/31/93 # $Id: $ @ 1.4 log @sync with 4.4lite @ text @d35 2 a36 1 # @@(#)dirs 8.1 (Berkeley) 5/31/93 @ 1.3 log @changed "Id" to "Header" for rcsids @ text @d1 2 a2 2 # Copyright (c) 1991 The Regents of the University of California. # All rights reserved. d35 1 a35 3 # @@(#)dirs 5.1 (Berkeley) 3/7/91 # # $Header: dirs,v 1.2 93/03/22 08:13:31 cgd Exp $ @ 1.2 log @added rcs ids to all files @ text @d37 1 a37 1 # $Id: dirs,v 1.2 93/03/21 22:16:30 cgd Exp $ @ 1.1 log @Initial revision @ text @d36 2 @ 1.1.1.1 log @initial import of 386bsd-0.1 sources @ text @@ 1.1.1.2 log @44lite code @ text @d1 2 a2 2 # Copyright (c) 1991, 1993 # The Regents of the University of California. All rights reserved. d35 1 a35 1 # @@(#)dirs 8.1 (Berkeley) 5/31/93 @