Find the answer to your Linux question:
Results 1 to 4 of 4
Use fgrep to search two files (in the same command) for the word Tool (case-matters). The first file exists and is README and the second file does NOT exist and ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    3

    what is the command of this in c shell

    Use fgrep to search two files (in the same command) for the word Tool (case-matters). The first file exists and is README and the second file does NOT exist and is called nothing. Redirect the standard output (which shows all the matches) to a file called stdout.txt and redirect the standard error (which tells that there is no file called nothing) to a file called srderr.txt

    so far what I got is:

    Code:
     fgrep Tool nothing ~cs352/spring08/assign0/README > stdout.txt 2> stderr.txt
    but it gives me this error of ambigous output redirect. How can I fix this?

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    He's scripting in csh, which is a no-no.

    Read here: Csh Programming Considered Harmful

    Save yourself a headache and write it in Bourne or bash.

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Sorry did not read the small print I naturally went to bash so I deleted comment.

  4. #4
    Just Joined!
    Join Date
    Jan 2008
    Posts
    3
    I already resolve this problem, the code is this:

    Code:
    $ (fgrep Tool nothing ~cs352/spring08/assign0/README > stdout.txt) >& stderr.txt
    thanks all for the help

Posting Permissions

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