From 40b33b6b04d81d2c6ca52175a83c31fa1bc91621 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 9 Mar 2020 04:00:31 -0400 Subject: Import /usr/src/bin/sh from FreeBSD 12.1-RELEASE --- bin/1sh/funcs/pushd | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 bin/1sh/funcs/pushd (limited to 'bin/1sh/funcs/pushd') diff --git a/bin/1sh/funcs/pushd b/bin/1sh/funcs/pushd new file mode 100644 index 00000000..11e3199c --- /dev/null +++ b/bin/1sh/funcs/pushd @@ -0,0 +1,73 @@ +#!/bin/sh + +#- +# 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. +# 3. 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. +# +# 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. +# +# @(#)pushd 8.2 (Berkeley) 5/4/95 +# $FreeBSD: releng/12.1/bin/sh/funcs/pushd 314436 2017-02-28 23:42:47Z imp $ + +# 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 + +pushd () { + SAVE=`pwd` + if [ "$1" = "" ] + then if [ "$DSTACK" = "" ] + then echo "pushd: directory stack empty." + return 1 + fi + set $DSTACK + cd $1 || return + shift 1 + DSTACK="$*" + else cd $1 > /dev/null || return + fi + DSTACK="$SAVE $DSTACK" + dirs +} + +popd () { + if [ "$DSTACK" = "" ] + then echo "popd: directory stack empty." + return 1 + fi + set $DSTACK + cd $1 + shift + DSTACK=$* + dirs +} + +dirs () { + echo "`pwd` $DSTACK" + return 0 +} -- cgit 1.4.1 -02Rewrite scheme in a more sensible orderJune McEnroe 2018-04-02Use function pointers in schemeJune McEnroe 2018-04-02Use union for scheme gen functionsJune McEnroe 2018-04-02Use uint32_t for len in schemeJune McEnroe 2018-04-01Add HSV output to schemeJune McEnroe 2018-03-31Output Linux console escapes from schemeJune McEnroe 2018-03-31Add scheme to READMEJune McEnroe 2018-03-31Brighten color schemeJune McEnroe 2018-03-31Set Dark terminal to schemeJune McEnroe 2018-03-31Lighten cursor colorJune McEnroe 2018-03-31Tweak cyan furtherJune McEnroe 2018-03-31Tweak colors in schemeJune McEnroe 2018-03-31Add scheme.png targetJune McEnroe 2018-03-31Generate Terminal.app color schemeJune McEnroe 2018-03-31Generate basic ANSI color schemeJune McEnroe 2018-03-31Add hex output to schemeJune McEnroe 2018-03-31Add color scheme PNG generatorJune McEnroe 2018-03-31Simplify gfxx palette generationJune McEnroe 2018-03-31Switch to HSV for gfxx palette generationJune McEnroe 2018-03-30Generate default palette in gfxxJune McEnroe 2018-03-30Ignore build and cloneJune McEnroe 2018-03-30Set g:clipboard to pb{copy,paste} alwaysJune McEnroe 2018-03-28Add d-_-b crateJune McEnroe