sed中求公共前缀 string1="test toast" string2="test test" printf "%s %s " "$string1" "$string2" | sed -e 'N;s/^(.*).* 1.*$/1/'