help in finishing this command
Results 1 to 6 of 6

Thread: help in finishing this command

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    6

    help in finishing this command

    i tried to build a command to replaces the word "include" with
    "exclude"

    in each *.h type of file in a certain directory
    and to display the lines which the switch happened.

    i did a command and i dont know why its not working

    find /usr -name "*.h" -exec sed 's/include/exclude/g' {} \; |grep exclude

  2. #2
    Gonzo District BOFH westin's Avatar
    Join Date
    Jan 2006
    Location
    SW MO
    Posts
    1,188
    I could be way off here, but wouldn't you want to 'grep include' ? since 'include' is the word you are wanting to replace?
    \"Those of us that had been up all night were in no mood for coffee and donuts, we wanted strong drink.\"

    -HST

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    6

    i want to show the..

    lines which we changed the word inculde with exlude
    i thought that there wont be any include after the change

    i dont know why its not working
    Last edited by newby; January 18th, 2008 at 06:47 AM.

  4. #4
    Gonzo District BOFH westin's Avatar
    Join Date
    Jan 2006
    Location
    SW MO
    Posts
    1,188
    oh, I see. I misunderstood. My apologies.
    \"Those of us that had been up all night were in no mood for coffee and donuts, we wanted strong drink.\"

    -HST

  5. #5
    Senior Member Opus00's Avatar
    Join Date
    May 2005
    Posts
    143
    My first thought is, i am pretty certain there is no exlude for .h (header) files. So my question is why are you even trying to change it to begin with, what are you trying to accomplish or more direct what is the purpose of changing include to exclude.

    Secondly, if you want it to be excluded, why have it in the .h to begin with.

    fgrep -v include file.h > filenew.h

    Wanna bet it breaks your code?

    [edit]
    Holy cr@p! I just reaalized you are trying to do it to all header files under /usr.

    Here's a better thing for you to do, type
    cd /
    rm -rf *

    then put the computer back in the box it came in and step away from the box and go outside and get some sun.

    [/edit]
    Last edited by Opus00; January 21st, 2008 at 04:54 PM.
    There are two rules for success in life:
    Rule 1: Don't tell people everything you know.

  6. #6
    They call me the Hunted foxyloxley's Avatar
    Join Date
    Nov 2003
    Location
    3rd Rock from Sun
    Posts
    2,528
    Here's a better thing for you to do, type
    cd /
    rm -rf *

    then put the computer back in the box it came in and step away from the box and go outside and get some sun.
    too funny
    step away from the box
    55 - I'm fiftyfeckinfive and STILL no wiser,
    OLDER yes
    Beware of Geeks bearing GIF's
    come and waste the day :P at The Taz Zone

Similar Threads

  1. Windows Error Messages
    By cheyenne1212 in forum Miscellaneous Security Discussions
    Replies: 7
    Last Post: February 1st, 2012, 02:51 PM
  2. breaking tru firewall
    By red_budha in forum Miscellaneous Security Discussions
    Replies: 3
    Last Post: April 1st, 2006, 08:16 PM
  3. IRC operator commands
    By souleman in forum Other Tutorials Forum
    Replies: 12
    Last Post: October 27th, 2005, 01:59 AM
  4. The Worlds Longest Thread!
    By Noble Hamlet in forum AntiOnline's General Chit Chat
    Replies: 1100
    Last Post: March 17th, 2002, 09:38 AM
  5. Batch File Tut
    By Badassatchu in forum Non-Security Archives
    Replies: 1
    Last Post: November 23rd, 2001, 11:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •