标签: unix
line="I have a space"
我似乎不能grep这个。 $line | grep "[[:space:]]"
grep
$line | grep "[[:space:]]"
答案 0 :(得分:3)
这样可行,但您需要echo这一行:
echo
echo "I have a space" | grep "[[:space:]]"
答案 1 :(得分:2)
echo $line | grep " "