Originally, the qcd program couldn't run on Ubuntu, so I finally realized it. I hereby declare that I should make appropriate modifications on the basis of the qcd program. Original qcd code download link: free download link on http://linux.linuxidc.com/user name and password is the official website of www.linuxidc.com//tu/tututu/ tuqqqcd
Originally, the qcd program couldn't run on Ubuntu, so I finally realized it. I hereby declare that I should make appropriate modifications on the basis of the qcd program.
Source qcd code download link:
Free onHttp://linux.linuxidc.com/
Both the user name and password areWww.linuxidc.com
The specific download directory is in/October 12.04/October 7/October 7/cn-embedded qcd implementation on Ubuntu
Download Method see http://www.linuxidc.com/Linux/2013-07/87684.htm
Directly install cannot run. First, I changed bin_content =/usr/local/sbin In the install file to bin_content =/usr/local/bin, and then deleted qcd. sh.
Then we changed the 130 rows in the qcd code.
Echo $ enter_dir>/tmp/qcd_temp
Exit 0
The idea is to save the obtained path to the qcd_temp file. I originally wanted to change the path to cd directly in the shell program, but found that it was not feasible. I can only export the path in a roundabout way, and then use an alias to get an alias.
Alias cdd = 'cdd () {>/tmp/qcd_temp; qcd; if [$? -Eq 0]; then cd 'cat/tmp/qcd_temp '; fi ;}; cdd'
To make it take effect permanently, copy it to the/root/. bash_alias file.
It is hard to understand this sentence. First, clear the qcd_temp file, execute qcd, enter a number, and then export the path to the qcd_temp file, then, determine whether the returned value of the previous command is 0 (if the path can be exported, 0 is returned, and 1 is returned for other commands). Then, the path switching is achieved by cd, it was easy to write. After a long time, I finally got it done, so I recorded it.
The final implementation is to use the qcd-s path to save the path, and then use cdd to jump, which saves a lot of time to switch the path.