Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #202334

Re: pushd/popd

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: pushd/popd
Date 2018-11-12 14:50 +0100
Message-ID <wTkLg-2bz-3@gated-at.bofh.it> (permalink)
References <wQsP0-xe-13@gated-at.bofh.it> <wREXL-3XP-5@gated-at.bofh.it> <wSgA1-28q-3@gated-at.bofh.it> <wSGb7-1pD-1@gated-at.bofh.it> <wSQWR-8h2-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Nov 10, 2018 at 11:58:53PM -0600, David Wright wrote:
> BTW whenever I change directory in scripts, I make sure that I'm in a
> subshell by using ( and ), which guarantees that I get back to the
> same directory however the script finishes.

Depends on the script.  For scripts that change directory more than
once (e.g. a software building script that runs "make" in several
directories, one by one), I concur.  That is sound advice.

For a script that only changes directory once and then does everything
from that directory (e.g. a wrapper), a subshell may be the exact
opposite of what's wanted.  In such cases, you would simply do
"cd /some/where || exit" at the top of the script.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-04 16:50 +0100
  Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-04 19:00 +0100
    Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-07 12:30 +0100
      Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-07 13:10 +0100
        Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-07 15:40 +0100
  Re: Archiving content of a directory on a DVD-R. David Christensen <dpchrist@holgerdanske.com> - 2018-11-05 00:20 +0100
  Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-05 15:10 +0100
    Re: Archiving content of a directory on a DVD-R. <tomas@tuxteam.de> - 2018-11-05 15:40 +0100
  Re : Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-07 23:40 +0100
    Re: Archiving content of a directory on a DVD-R. "Thomas Schmitt" <scdbackup@gmx.net> - 2018-11-08 09:00 +0100
  Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-08 00:00 +0100
    pushd/podp (was Re: Archiving content of a directory on a DVD-R.) Jonathan Dowland <jmtd@debian.org> - 2018-11-08 10:50 +0100
      Re: pushd/popd peter@easthope.ca - 2018-11-09 16:10 +0100
        Re: pushd/popd Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-09 17:30 +0100
          Re: pushd/popd Jonathan Dowland <jmtd@debian.org> - 2018-11-09 21:50 +0100
        Re: pushd/popd Jonathan Dowland <jmtd@debian.org> - 2018-11-09 17:30 +0100
        Re: pushd/popd peter@easthope.ca - 2018-11-10 19:30 +0100
          Re: pushd/popd David Wright <deblis@lionunicorn.co.uk> - 2018-11-11 07:00 +0100
            Re: pushd/popd Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-12 14:50 +0100
              Re: pushd/popd David Wright <deblis@lionunicorn.co.uk> - 2018-11-12 21:40 +0100
    Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-08 14:20 +0100
      Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-12 23:00 +0100
        Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-12 23:20 +0100
          Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-13 03:40 +0100
            Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-13 14:20 +0100
              Re: Archiving content of a directory on a DVD-R. peter@easthope.ca - 2018-11-13 16:00 +0100
              Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-14 11:00 +0100
                Re: Archiving content of a directory on a DVD-R. Greg Wooledge <wooledg@eeg.ccf.org> - 2018-11-14 14:40 +0100
                Re: Archiving content of a directory on a DVD-R. Jonathan Dowland <jmtd@debian.org> - 2018-11-14 16:40 +0100

csiph-web