3 ms·
"keep the first word of every line (where word is defined by alnum chars + underscores for simplicity sake)" sed -E s_[a-zA-Z0-9_]+.*_\1_' file.txt You're m
by tyingq 5y ago
"keep the first word of every line (where word is defined by alnum chars + underscores for simplicity sake)"
sed -E s_[a-zA-Z0-9_]+.*_\1_' file.txt
You're missing an opening single quote and a set of parentheses for this to work. It feels like you should have a unit test setup for these snippets, given that there are other typos found in other comments here.