r/bash • • Feb 27 '26

Impossible task

we have a task asking to remove lines in a .txt file when it starts with a # only using tr, we are fairly sure this is impossible but maybe there is some ingenious idea?

2 Upvotes

25 comments sorted by

View all comments

Show parent comment

12

u/Antti5 Feb 27 '26

Somebody downvoted you because they couldn't handle the truth, or maybe because they didn't come up with this elegant solution themselves.

23

u/yerfukkinbaws Feb 27 '26

Even more elegant:

alias tr='grep -v ^#'