我怎样才能让它工作?
#!/bin/bash
SOMETHING=$(egrep '^ something' /some/dir/file.conf | awk -F '.' '{print $1}' | awk '{print $2}')
if [ $SOMETHING = 123 ]; then
echo "Found 123"
else
echo "Cannot find 123" && exit 1
fi
结果 grep 抱怨语法错误。它不喜欢'^某事'