📄 install
字号:
#!/bin/sh#qcd install #written by xiewei 2004 setup_content=/etc/qcdhistory_dir=$setup_content/history_dirbin_content=/usr/local/sbinprof_content=/etc/profile.dsetup(){ #check if [ -r $history_dir ] #如果$history_dir 对当前用户可读 then echo -n "You have installed qcd , overwrite it(y\Y or q\Q or n\N)? " while read choice do if [ "$choice" = "y" -o "$choice" = "Y" ] #要改写安装路径 then break fi if [ "$choice" = "q" -o "$choice" = "Q" ] #什么也不做退出 then echo "Nothing to do!" exit 1 fi if [ "$choice" = "n" -o "$choice" = "N" ] #安装到默认的位置 then cp -f ./qcd $bin_content/ cp -f ./qcd.sh $prof_content/ echo "install qcd OK, but do not overwrite it!" echo "version is 1.00" exit 1 fi echo -n "You have installed qcd, overwrite it(y\Y or q\Q or n\N)? " done fi if [ -r $setup_content ] then : else mkdir $setup_content fi cp -f ./qcd $bin_content/ cp -f ./history_dir $setup_content/ cp -f ./qcd.sh $prof_content/}delete(){ [ -r $history_dir ] || [ -r $bin_content ] || \ ! echo "Your computer has not qcd!" || ! echo "Nothing to do!" echo -n "Are you sure to delete qcd(y\Y or q\Q)? " while read choice do if [ "$choice" = "y" -o "$choice" = "Y" ] then break fi if [ "$choice" = "q" -o "$choice" = "Q" ] then echo "Nothing to do!" exit 1 fi echo -n "Are you sure to delete qcd(y\Y or q\Q)? " done rm -rf $setup_content rm -f $bin_content/qcd rm -f $prof_content/qcd.sh}usage(){ echo "<install> install qcd on your computer." echo "<install del> delete qcd from your computer." exit 1}echo "Qcd Install Software"echo "Written By XieWei 2004" if [ $# -eq 0 ] #如果传入的参数个数为0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -