加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
merge_snippets.sh 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
if [ $# -ne 1 ]; then
echo -e "Usage:"
echo -e " $ ./merge_snippets.sh new_hosts\n"
exit 1
fi
new_hosts_file=$1
if [ -f $new_hosts_file ]; then
new_hosts_file=${new_hosts_file}".new"
printf "" > $new_hosts_file
fi
printf "\
## __ __ \r\n\
## |__| _____ __ __ ┌─────┐ | | __ \r\n\
## | || || | || ──| ______ | |──┐┌─────┐.─────.| |_ .─────.\r\n\
## | || ─ || | || ─ | |______| | || ─ ||__ ──|| _||__ ──|\r\n\
## |__|| ┌──┘ \___/ |_____| |__|__||_____||_____||____||_____|\r\n\
## |__| \r\n\
## · lennylxx ·\r\n\
##\r\n\
## +------------------------- >>d(' _ ')b<< -------------------------+\r\n\
## | |\r\n\
## | Project: https://github.com/lennylxx/ipv6-hosts |\r\n\
## | Update : `date +"%a, %d %b %Y %T %z"` |\r\n\
## | |\r\n\
## +-------------------------------------------------------------------+\r\n\
" >> $new_hosts_file
printf "\r\n::1 localhost\r\n\r\n" >> $new_hosts_file
cat snippets/??_*.txt >> $new_hosts_file
printf "\
## +-------------------------------------------------------------------+\r\n\
## | End of File |\r\n\
## +-------------------------------------------------------------------+\r\n\
" >> $new_hosts_file
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化