Process multiple files with sed
Already a Member? Join your peers on the Internet's largest technical computer professional community. It's easy to join and it's free. Register now while it's still free! Already a member? Close this window and log in. Join Us Close.
Join Tek-Tips Forums! Join Us! By joining you are opting in to receive e-mail. Promoting, selling, recruiting, coursework and thesis posting is forbidden. Finally I added a grep redirected to the logfile to log the changes made in the file s. This worked for me in GNU Bash 4.
How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Change multiple files Ask Question. Asked 9 years, 8 months ago. Active 2 years, 11 months ago. Viewed k times. The following command is correctly changing the contents of 2 files. Improve this question. Birei The answers here don't suffice.
See unix. Here's another answer on updating many files at once: unix. I did PaulR solution and it worked, but what I don't understand is all these complicated other answers! What is missing from your solution? Add a comment. Active Oldest Votes. I'm surprised nobody has mentioned the -exec argument to find, which is intended for this type of use-case, although it will start a process for each matching file name: find. Improve this answer. I had to modify the command in this answer like so: find.
The find command works as it is supplied by ealfonso,. But xargs is a better choice in general because it also allows parallel processing with the -p option. Productivity Too many technologies to explore, not much time available 8. Website Design 9. Software Development Windows- Sysadmin, reboot etc. Delete 4th and 2nd line from the input This sed example deletes 4th and 2nd line from the file thegeekstuff. Guy Patterson October 22, , pm. John Alles January 20, , am. Do you know easier way for taht?
Sasikala January 20, , pm. HuGo March 14, , am. I will be posting instruction guides, how-to, troubleshooting tips and tricks on Linux, database, hardware, security and web. My focus is to write articles that will either teach you or help you resolve a problem. Read more about Ramesh Natarajan and the blog.
0コメント