problem with shell script syntax

Posted on 2006-05-25
Last Modified: 2010-04-21
I'd like to write a shell script to scan and file and look for a string and if the string exist to echo it on the console
by example: i like to look for in /root/myips if found echo it to the screen.

i'D also like to write a shell script to write a string to a file.

by example: i d like to write to /root/myips, i do not my data to be overwritten

3) how can i remove a string from a file
by example: i'd like to remove from /root/myips

please help, ty
Question by:247RealMedia
    1 Comment
    LVL 84

    Accepted Solution

    fgrep  /root/myips
    echo >> /root/myip
    perl -i.bak -pe 's/\Q172.16.8.222\E//g'  /root/myip

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 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

    16 Experts available now in Live!

    Get 1:1 Help Now