首頁 > 軟體

Linux下一鍵安裝 PowerShell 的bash指令碼

2020-06-16 18:09:09

說明

目前,Linux下的PowerShell約等於pash。希望大家專注mono,關注pash。一鍵安裝指令碼包括for CentOS6,centos7,Ubuntu 14.04  ubuntu 14.10。

安裝指令碼是用yum或apt安裝,mono官方最新版,然後編譯安裝pash最新版,最後生成兩個命令:

mybuild用於編譯pash

mypash用於執行pash

1 centos6

#!/bin/bash
# centos6,一鍵安裝mono,pash的shell指令碼。
# centos 6.6 測試通過。
# 在linux下用: 
# cd    xxxx   
# xxxx 為要進入的目錄。   
# bash  ./install_pash.txt     
# 執行。

#指令碼開始
yum  -y  install wget git

#安裝mono
#http://software.openSUSE.org/download/package?project=home:tpokorra:mono&package=mono-opt
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:tpokorra:mono/CentOS_CentOS-6/home:tpokorra:mono.repo
yum  -y  install mono-opt

# 建立兩個bash的alias,
#mybuild為編譯,或更新pash
#mypash為執行pash
# powershell 傳教士 原創 2015-02-01 允許轉載,但必須保留名字和出處,否則追究法律責任
echo "alias mybuild='cd / ;rm -rf /Pash ; git  clone  https://github.com/Pash-Project/Pash.git ; cd /Pash/ ; /opt/mono/bin/xbuild    /Pash/Pash.proj'"    >>  /root/.bashrc
echo "alias mypash='/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe'"  >>  /root/.bashrc


#安裝pash
cd /
rm -rf /Pash
git  clone  https://github.com/Pash-Project/Pash.git
cd /Pash/
/opt/mono/bin/xbuild    /Pash/Pash.proj

sleep 6

#執行
/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe

2 centos7

#!/bin/bash
# centos7,一鍵安裝mono,pash的shell指令碼。
# 在linux下用: 
# cd    xxxx   
# xxxx 為要進入的目錄。   
# bash  ./centos7_install_pash.txt
# 執行。

#指令碼開始
yum  -y  install wget git

#安裝mono
#http://software.opensuse.org/download/package?project=home:tpokorra:mono&package=mono-opt
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:tpokorra:mono/CentOS_CentOS-7/home:tpokorra:mono.repo
yum  -y  install mono-opt

# 建立兩個bash的alias,
#mybuild為編譯,或更新pash
#mypash為執行pash
# powershell 傳教士 原創 2015-02-01 允許轉載,但必須保留名字和出處,否則追究法律責任
echo "alias mybuild='cd / ;rm -rf /Pash ; git  clone  https://github.com/Pash-Project/Pash.git ; cd /Pash/ ; /opt/mono/bin/xbuild    /Pash/Pash.proj'"    >>  /root/.bashrc
echo "alias mypash='/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe'"  >>  /root/.bashrc

#安裝pash
cd /
rm -rf /Pash
git  clone  https://github.com/Pash-Project/Pash.git
cd /Pash/
/opt/mono/bin/xbuild    /Pash/Pash.proj

sleep 6

#執行
/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe

3 ubuntu 14.04

#!/bin/bash
# ubuntu14.04,一鍵安裝mono,pash的shell指令碼。
# ubuntu 14.04 測試通過。
# 在linux下用: 
# cd    xxxx   
# xxxx 為要進入的目錄。   
# bash  ./ubuntu1404_install_pash.txt     
# 執行。

#指令碼開始
sudo apt-get update
sudo apt-get  -y  install wget git

# http://software.opensuse.org/download/package?project=home:tpokorra:mono&package=mono-opt
#安裝mono
wget http://download.opensuse.org/repositories/home:tpokorra:mono/xUbuntu_14.04/Release.key
sudo apt-key add - < Release.key 

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_14.04/ /' >> /etc/apt/sources.list.d/mono-opt.list"

sudo apt-get update
sudo apt-get  -y  install mono-opt

# 建立兩個bash的alias,
#mybuild為編譯,或更新pash
#mypash為執行pash
# powershell 傳教士 原創 2015-02-01 允許轉載,但必須保留名字和出處,否則追究法律責任
echo "alias mybuild='cd / ;rm -rf /Pash ; git  clone  https://github.com/Pash-Project/Pash.git ; cd /Pash/ ; /opt/mono/bin/xbuild    /Pash/Pash.proj'"    >>  /root/.bashrc
echo "alias mypash='/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe'"  >>  /root/.bashrc

#安裝pash
cd /
rm -rf /Pash
git  clone  https://github.com/Pash-Project/Pash.git
cd /Pash/
/opt/mono/bin/xbuild    /Pash/Pash.proj

sleep 6

#執行
/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe

4 ubuntu14.10

#!/bin/bash
# ubuntu14.10,一鍵安裝mono,pash的shell指令碼。
# 在linux下用: 
# cd    xxxx   
# xxxx 為要進入的目錄。   
# bash  ./ubuntu14010_install_pash.txt     
# 執行。

#指令碼開始
sudo apt-get update
sudo apt-get  -y  install wget git

# http://software.opensuse.org/download/package?project=home:tpokorra:mono&package=mono-opt
#安裝mono
wget http://download.opensuse.org/repositories/home:tpokorra:mono/xUbuntu_14.10/Release.key
sudo apt-key add - < Release.key

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_14.10/ /' >> /etc/apt/sources.list.d/mono-opt.list"

sudo apt-get update
sudo apt-get  -y  install mono-opt

# 建立兩個bash的alias,
#mybuild為編譯,或更新pash
#mypash為執行pash
# powershell 傳教士 原創 2015-02-01 允許轉載,但必須保留名字和出處,否則追究法律責任
echo "alias mybuild='cd / ;rm -rf /Pash ; git  clone  https://github.com/Pash-Project/Pash.git ; cd /Pash/ ; /opt/mono/bin/xbuild    /Pash/Pash.proj'"    >>  /root/.bashrc
echo "alias mypash='/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe'"  >>  /root/.bashrc

#安裝pash
cd /
rm -rf /Pash
git  clone  https://github.com/Pash-Project/Pash.git
cd /Pash/
/opt/mono/bin/xbuild    /Pash/Pash.proj

sleep 6

#執行
/opt/mono/bin/mono  /Pash/Source/PashConsole/bin/Debug/Pash.exe


IT145.com E-mail:sddin#qq.com