Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Posts
    2

    Unanswered: a simple 'awk' doesn't work?!



    just want to replace the space and "go" in the sample file to No space and "GO", so I think something like follows would work, but not... couldn't figure out what's wrong... please help!

    awk '{ sub(" go", "GO"); print}' test2.txt
    awk: syntax error near line 1
    awk: illegal statement near line 1

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    You'd do better just using the sed command

    Code:
    cat test2.txt | sed 's/ go/GO/'
    Mike

  3. #3
    Join Date
    May 2007
    Location
    Milano, Italy
    Posts
    22
    On Solaris [/usr]/bin/awk is too old and broken.
    Use nawk or /usr/xpg4/bin/awk.

Posting Permissions

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