put all lines in comment where de word DEBUG is found

sed -i 's/^.*DEBUG.*/#&/' $file

By: svg
2009-07-30 09:20:37

What Others Think

"sed -i" is very powerfull. I love it. :-) myfile.txt instead of $file ?
flux · 669 weeks and 1 day ago
This platform always provides us some incredible piece of command keys. That always helps us in our work. You can check this https://essayguru.org/do-my-homework to update to manage their assignment work. And i must say that this command line key that they shared is above all. Thank you so much for sharing it with us.
Foster · 97 weeks and 3 days ago
You have to check [url=https://techy-brand.com/weight-loss/]best natural weight loss supplements[/url] to get more techniques to manage their work.
CalvinRivera · 93 weeks and 4 days ago
You have to check best natural weight loss supplements to get more techniques to manage their work.
CalvinRivera · 93 weeks and 4 days ago
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Dental Smiles London dentist
muneerahmed · 61 weeks and 4 days ago
You can get the all replies to the comments that were shared by the subscribers of this it was good to get all these. I have to make some more forums on this so I decided to get the topic for rudn enclave so I can make it as on them that was easy for me or have the all formats on it.
Gabrielleoulding · 15 weeks and 1 day ago
very good post, i surely really like this excellent website, persist with it http://Pointpills.com">Buy Nembutal Powder
mtom78632 · 8 weeks and 6 days ago
I discovered a great deal of interesting stuff in your blog especially it’s dialogue select carts
mtom78632 · 5 weeks and 4 days ago
birthday invitations should be given as early as possible to avoid any surprises- glo extracts
mtom78632 · 4 weeks and 6 days ago
building websites is not only fun, but it can also generate an income for yourself. ?????
mtom78632 · 2 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: