2020年11月30日 星期一

安裝 plink 2

 #!/bin/bash
# install PLINK 2.00 alpha
# https://www.cog-genomics.org/plink/2.0/

src=http://s3.amazonaws.com/plink2-assets/alpha2/plink2_linux_x86_64.zip
src=https://s3.amazonaws.com/plink2-assets/plink2_linux_x86_64_20211125.zip
target=/opt/PLINK2a


[ $(which busybox) ]&& { for i in wget unzip;do [ -f "/usr/local/bin/${i}" ] || ln -s $(which busybox) /usr/local/bin/${i}; done; };
for i in unzip wget;do [ $(which ${i}) ]&& : || { echo check ${i}: not found ${i}! &&exit 1; } ;done;
[ -d "$target" ]&&mv ${target} ${target}.$(date +%Y-%m-%d-%H-%M);
mkdir -p $target;cd $target;
echo $target >readme.txt;echo $src >>readme.txt
wget -q -O- $src | unzip -;
chmod a+x plink2;cd -;
for i in plink2;do [ -f "/usr/local/bin/${i}" ]&&mv /usr/local/bin/${i} /usr/local/bin/${i}.$(date +%Y-%m-%d-%H-%M);   ln -s ${target}/${i} /usr/local/bin/${i};done;
~      

沒有留言: