simple shell

This is a discussion on simple shell within the Linux Programming forums, part of the Platform Specific Boards category; I have a variable COMMAND that contains COMMAND="grep \"TEXT\" myfile" when i echo $COMMAND I get grep "DOG CAT" myfile ...

  1. #1
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49

    simple shell

    I have a variable COMMAND that contains

    COMMAND="grep \"TEXT\" myfile"

    when i echo $COMMAND I get

    grep "DOG CAT" myfile

    when i execute

    $COMMAND

    it does not work properly

    Does anyone know why this is not working

  2. #2
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49
    RATHER THAT WAS $TEXT not TEXT
    Ivan

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Try

    eval $COMMAND
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49
    it worked thanks!!!!!!!!!
    Ivan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 34
    Last Post: 05-27-2009, 12:26 PM
  2. Implement Redirection for a simple shell
    By koooee in forum C Programming
    Replies: 4
    Last Post: 02-22-2009, 02:21 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. System.ini Shell Problems
    By (TNT) in forum Windows Programming
    Replies: 2
    Last Post: 08-26-2001, 01:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21