我有以下bash脚本:
#!/bin/bash
#read user input and save to package variable
PACKAGE=${1}
#put variable value in double quotes and add .sty extension.
echo "Searching..."
SEARCH=$(tlmgr search --global --file \"$PACKAGE.sty\"
regex="[a-z]+\:"
if [[ $SEARCH =~ $regex ]]; then
echo #code that prints matches here
fi
我想回显与grep相同的匹配项,而不是像“找到的匹配项”那样显示常规消息。