2016-04-18 52 views
0

我正在使用GIT bash。 我有這個文件「proxy_functions.txt」:從txt添加函數到Git bash

function proxy(){ 
    echo -n "username:" 
    read -e username 
    echo -n "password:" 
    read -es password 
    export http_proxy="http://$username:[email protected]:8080/" 
    export https_proxy=$http_proxy 
    export ftp_proxy=$http_proxy 
    export rsync_proxy=$http_proxy 
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" 
    echo -e "\nProxy environment variable set." 
} 

function proxyoff(){ 
    unset HTTP_PROXY 
    unset http_proxy 
    unset HTTPS_PROXY 
    unset https_proxy 
    unset FTP_PROXY 
    unset ftp_proxy 
    unset RSYNC_PROXY 
    unset rsync_proxy 
    echo -e "\nProxy environment variable removed." 
} 

裝在我的bash GIT爲了,當我在寫殼「代理」,然後我的用戶和代理的通有GIT打壞準備推的東西給我在GIT樞紐在線回購...

它用於正常工作,但現在我想我搞砸了怎麼一回事,因爲當我寫在GIT bash的「代理」,它說

bash: proxy: command not found 

如何從txt文件「proxy_functions.txt」重新插入GIT bash中的命令書面?

+0

你有沒有源'.bashrc'後添加的功能() – Inian

+0

這是非常可能的。 ...我必須修改該文件中的某些內容? – Arcones

+0

我剛剛搜索過,我只在GIT安裝的目錄中找到「bash.bashrc」文件,它與您指的是相同的文件嗎? – Arcones

回答

1

您需要在bash.bashrc文件中找到proxy_functions.txt腳本。所以,如果例如proxy_functions.txt位於C:\Users\Arcones\proxy_functions.txt,那麼你需要在你的bash.bashrc文件中的一行,上面寫着:

source C:\Users\Arcones\proxy_functions.txt 
+0

是的!!!這是! – Arcones