⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pushd

📁 Berkely的学生写的
💻
字号:
#!/bin/sh# Chapter 14 - Functions# This script implements the csh command pushd and pushes a# directory onto the directory stack.# You will need to "source" this file into your environment# using the . command.pushd() {    # set the requested directory, $REQ, to the first argument    # If no argument is given, set REQ to .    REQ="$1";     if [ -z "$REQ" ] ; then REQ=. ; fi    # if $REQ is a directory, cd to the directory    # if the cd is successful update $_DIR_STACK    # otherwise issue the appropriate error messages    if [ -d "$REQ" ] ; then        cd "$REQ" > /dev/null 2>&1        if [ $? -eq 0 ] ; then            _DIR_STACK="`pwd`:$_DIR_STACK" ; export _DIR_STACK ;            dirs        else            echo "ERROR: Cannot change to directory $REQ." >&2        fi    else        echo "ERROR: $REQ is not a directory." >&2    fi    unset REQ}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -