各位大佬,为啥我自己写的缝合怪脚本还是不行哈

查看 22|回复 0
作者:佳辉的春天   
目前两个问题是
问题1:发现脚本1的结果没有显示,似乎脚本1没有执行.
问题2:发现脚本4执行时会清空屏幕,导致之前的内容都清空了..
GPT的头都被我问大了哈~~
[ol]#!/bin/bash
# 清屏操作
clear
echo "脚本执行开始"
# 创建四个临时文件来存储各个脚本的输出
temp_file1=$(mktemp)
temp_file2=$(mktemp)
temp_file3=$(mktemp)
temp_file4=$(mktemp)
current_screen=$(mktemp)
# 执行代码1(需要交互式输入4),并将输出存储到临时文件1
echo "4" | curl -L -s check.unlock.media > $temp_file1
# 使用 script 命令来捕获彩色输出
script -q -c "curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh" $temp_file2
# 移除 script 输出文件中的头部和尾部(如果需要)
sed -i '1d;$d' $temp_file2
# 执行脚本3,并将输出存储到临时文件3
script -q -c "curl -sL yabs.sh | bash -s -- -i" $temp_file3
sed -i '1d;$d' $temp_file3
# 保存当前屏幕内容
tput smcup
cat $temp_file1
cat $temp_file2
cat $temp_file3
tput rmcup
# 执行脚本4(需要交互式输入2),并将输出存储到临时文件4
echo "2" | script -q -c "bash 复制代码

脚本, 临时文件, 并将

您需要登录后才可以回帖 登录 | 立即注册

返回顶部