Shell rewrite built-in command--CD

Source: Internet
Author: User

Introduction to the scene

Use Cygwin under Windows, use Apktool to repackage apk;

Way One

CD D:
CD path/to/apk/in/d
Apktool D name.apk

Way Two

Drag the file into the Cygwin window to delete the trailing file name
CTRL + A
CD SPACE
Apktool D name.apk

Mode three
`I`

Drag a file into the Cygwin window


cd SPACE `dirname ******`

Mode Four

Drag file directory directly to Cygwin

Way FINAL-1

Modify the. BASHRC: Override CD Method


function cd_func(){ if [ -f $1 ]; then cd `dirname $1` else cd [email protected] fi}alias cd=cd_func

Drag the file to the Cygwin window
CTRL + A
CD SPACE

Tail notes

The Cd_func there is a small problem, when using the CD without parameters, the CD will be executed, the dirname $1 command to execute the dirname (no parameter) will be the first help information, but in the script will not prompt, so in terms of use should still live, if the obsessive-compulsive friends can change their code;
PS: Can't Lose is


if [ "x"$1 != "x" && -f $1] ;then cd `dirname $1` else cd [email protected]fi

Shell rewrite built-in command--CD

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.