shell script to change value inside files

Posted on 2006-04-10
Last Modified: 2013-12-27

On Solaris 10
I have 1000 files with a few lines in each one of them.
I need to change the word LOGGING to NOLOGGING.
Can some one, please, post the script to do so.
It has to be done only once and the string LOGGING will only apear once in each line.

Question by:peledc
    1 Comment
    LVL 4

    Accepted Solution

    sed 's/LOGGING/NOLOGGING/' filename >
    mv filename

    Should change LOGGING to NOLOGGING in one file. To use these commands on 1000 files, a loop would be needed. Is there a pattern for the files in which the changes needs to be they all exist in a directory or have a particular filename pattern etc.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now