获得徽章 6
一段有意思的 shell 脚本
command="$@"
log_file="command_execution.log"
echo "========================================" | tee -a "$log_file"
echo "时间: $(date)" | tee -a "$log_file"
echo "命令: $command" | tee -a "$log_file"
echo "========================================" | tee -a "$log_file"
# 使用Bash内置计时器
start_time=$SECONDS
# 使用临时文件避免子shell问题
temp_file=$(mktemp)
eval "$command" 2>&1 | tee "$temp_file"
exit_code=${PIPESTATUS[0]}
# 将输出追加到日志文件
cat "$temp_file" >> "$log_file"
rm "$temp_file"
duration=$((SECONDS - start_time))
echo "========================================" | tee -a "$log_file"
echo "退出码: $exit_code" | tee -a "$log_file"
echo "耗时: ${duration}秒" | tee -a "$log_file"
command="$@"
log_file="command_execution.log"
echo "========================================" | tee -a "$log_file"
echo "时间: $(date)" | tee -a "$log_file"
echo "命令: $command" | tee -a "$log_file"
echo "========================================" | tee -a "$log_file"
# 使用Bash内置计时器
start_time=$SECONDS
# 使用临时文件避免子shell问题
temp_file=$(mktemp)
eval "$command" 2>&1 | tee "$temp_file"
exit_code=${PIPESTATUS[0]}
# 将输出追加到日志文件
cat "$temp_file" >> "$log_file"
rm "$temp_file"
duration=$((SECONDS - start_time))
echo "========================================" | tee -a "$log_file"
echo "退出码: $exit_code" | tee -a "$log_file"
echo "耗时: ${duration}秒" | tee -a "$log_file"
展开
评论
点赞
2025 年最佳 AI 产品排名结果:
1.Cursor-AI 编程
2.Claude-AI 助手
3.NotebookLM-AI 研究
4.Wispr Flow- 语音输入
5.Granola-会议记录
6.Comet-AI 浏览器
7.Nano Banana Pro-AI 图像
8.Manus-通用 AI Agent
9.Tesla-全自动驾驶
1.Cursor-AI 编程
2.Claude-AI 助手
3.NotebookLM-AI 研究
4.Wispr Flow- 语音输入
5.Granola-会议记录
6.Comet-AI 浏览器
7.Nano Banana Pro-AI 图像
8.Manus-通用 AI Agent
9.Tesla-全自动驾驶
展开
2
1
2
1
自己写的代码 被自己写的 WAF 拦截, 是暂停 waf 呢 还是修改代码呢?
⚠️ 拦截原因:攻击检测: Upload Attack - Path Traversal in Filename
⚠️ 拦截原因:攻击检测: SQL Injection - Comment Injection
⚠️ 拦截原因:攻击检测: Upload Attack - Path Traversal in Filename
⚠️ 拦截原因:攻击检测: SQL Injection - Comment Injection
展开
2
点赞
#Trae.ai#
感觉要多读下毛选了, Vibe Codding 常用的两个提示词 很好用:
充分运用批评与自我批评这个武器,给我一个更好的版本
把你怀疑有问题的点直接标出来,不要躲在“可能”后面
感觉要多读下毛选了, Vibe Codding 常用的两个提示词 很好用:
充分运用批评与自我批评这个武器,给我一个更好的版本
把你怀疑有问题的点直接标出来,不要躲在“可能”后面
展开
评论
点赞