#!/bin/bash #Check if a filename is provided as an argument if [ "$#" -eq 0 ]; then echo "Usage: $0 " exit 1 fi echo"$0" # Get the filename from the command line argument filename="$1" exception=$(grep -A 12 "\[Build Exception\]:" "$filename") # Use grep to search for lines containing the word "error" error=$(grep "error" "$filename") echo "exception: $exception" echo "error: $error" # Pass the result to another script sh to_inner_wechat_robot.sh "$exception" sh blame.sh "$exception" sh to_inner_wechat_robot.sh "$error" sh blame.sh "$error"