popd: Performs equivalent of 'bash' command with same name

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pushdpopd.r

Description

popd is based on the cygwin bash manpages' description of these commands.

Usage

1
popd(dn=FALSE, pull=0)

Arguments

dn

Determines whether a stack "pop" is to be performed. This is the equivalent of the first argument in bash:popd . If dn is FALSE and pull is zero, then set the new directory to the value at the top of the stack. If dn is TRUE then do not change directory, and look to pull for modifying the stack. See details for why the conditions are set this way.

pull

Equivalent of the latter n arguments in bash. Removes the stack entry corresponding to the pull's value ; can be positive or negative. Note that there may be some inconsistency in how this is handled in different implementations of bash.

Details

Recommend reading man bash for full details of the operations. This implementation will not change the working directory if dn is TRUE The directory history is stored in a file .dirhist, typically first created with pushd .

Value

A status value: 0 for success or 1 if there is no stack file (.dirhist). Future upgrades may include other codes for other failure mechanisms, but for now error messages will have to suffice.

Author(s)

Carl Witthoft carl@witthoft.com

See Also

pushd , setwd

Examples

1
2
3
4
5
6
## depends on your local directory structure and permissions
getwd()
pushd("~/..")
getwd()
popd()
getwd()


cgwtools documentation built on May 19, 2017, 11:47 p.m.
Search within the cgwtools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.