duangsuse::Echo
#!/bin/sh # Telegram PL 互骂组 AI 脚本文字重置版 # 兼容 Zsh、Bash、Sh function ai() { local user_input; while read user_input < "${1:-/dev/stdin}"; do local ai="\e[1;32m" ui="\e[0m"; echo "${ai}$user_input ${ui}" | sed 's/?\|?/!/g' | sed 's/吗//g' if […
顺手学了一下 POSIX ShellScript 系语言使用 #PL #Sysadim #UNIX #Linux #Bash
顺推 sort、shuf(fle)(洗牌)、head、uniq、comm、nl、tr、sed(Stream EDitor) 这些基于换行符的 pipeline routines
顺推 sort、shuf(fle)(洗牌)、head、uniq、comm、nl、tr、sed(Stream EDitor) 这些基于换行符的 pipeline routines
#!/bin/sh
# Telegram PL 互骂组 AI 脚本文字重置版
# 兼容 Zsh、Bash、Sh
function ai_print_prompt() {
printf '\e[34m㉄:\e[0m' # print prompt
}
function ai() {
local user_input;
ai_print_prompt;
while read user_input < "${1:-/dev/stdin}"; do
local ai="\e[1;32m" ui="\e[0m";
printf "${ai}$user_input ${ui}\n" | sed 's/?\|?/!/g' | sed 's/吗//g';
if [ `expr "$user_input" : '^再见'` -gt 0 ]; then break; fi
ai_print_prompt;
done
}
if [ $0 = 'ai.sh' ]
then
ai
fi