16 lines
366 B
Bash
16 lines
366 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Check if a filename is provided as an argument
|
||
|
if [ "$#" -eq 0 ]; then
|
||
|
echo "Usage: $0 <filename>"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# Get the filename from the command line argument
|
||
|
filename="$1"
|
||
|
|
||
|
# Use grep to search for lines containing the word "error"
|
||
|
result=$(grep "error" "$filename")
|
||
|
|
||
|
# Pass the result to another script
|
||
|
sh to_inner_wechat_robot.sh "$result"
|