1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What's happening here?

Discussion in 'Support' started by vefatica, Apr 27, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    What's happening here?

    Code:
    v:\test8> echo foobar > filename[11111111].dat
    
    v:\test8> dir /b
    filename
    
    v:\test8> type filename
    foobar [11111111].dat
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,311
    Likes Received:
    39
    I think you need to quote that filename.
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    On Tue, 27 Apr 2010 23:04:32 -0400, Charles Dye <> wrote:

    |---Quote (Originally by vefatica)---
    |What's happening here?
    |
    |
    |Code:
    |---------
    |v:\test8> echo foobar > filename[11111111].dat
    |
    |v:\test8> dir /b
    |filename
    |
    |v:\test8> type filename
    |foobar [11111111].dat
    |---------
    |---End Quote---
    |I think you need to quote that filename.

    Yes. But why? Is TCC terminating the file name at "[" (not legal in a SFN)?

    I never knew you could put redirection **anywhere** in the command line.

    v:\> echo My dog>doggy.txt has fleas.

    v:\> type doggy.txt
    My dog has fleas.
    --
    - Vince
     
  4. dim

    dim Dimitry Andric

    Joined:
    May 31, 2008
    Messages:
    203
    Likes Received:
    0
    On 2010-04-28 05:17, vefatica wrote:

    Yes, that has been possible since whenever redirection was invented. :)
    A redirection operator binds to the first argument to the right of it,
    and anything following it, is just appended to any existing command line
    arguments.

    E.g.:

    grep -i foo < bar > baz

    can also be specified as:

    grep -i < bar > baz foo

    or:

    grep > baz < bar -i foo

    etc. Maybe this is why some people prefer to splice the redirection
    operator and its argument together without a space, to clarify these two
    belong together, e.g.:

    grep -i foo <bar >baz
     

Share This Page