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

DO /P?

Discussion in 'Support' started by vefatica, Jun 30, 2016.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    1. There is no link from "DO /P" (at the top of DO's help) to the explanation at the bottom.

    2. I figured the opening '(' of DO's command would signal the end of DO's control arguments. So I was surprised at:
    Code:
    c:\users\vefatica\desktop> do l in /P grep aablock inbound.txt | cut -f1 ( echo %@word["/",1,%l] )
    cut: fatal error: Can not open file '('
    Usage : DO [n | FOREVER]
    Double-quoting "grep ... | cut -f1" doesn't work. Back-quoting it works, as well as escaping the '|'. Is there a correct way?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    There is a link, and it works fine here.

    The opening '(' isn't in DO, nor is it even in the same session as DO. "Cut" has been started in a child pipe session, and it has been passed the remainder of the command line ("-f1 ( echo %@word["/",1,%l] )") -- and I think it's unlikely that CUT is going to be able to understand any of that. It certainly isn't going to be able to process the DO argument or the variable function.

    You should either group the grep / cut block:

    do l in /P (grep aablock inbound.txt | cut -f1) ( echo %@word["/",1,%l] )

    or use back quoting. Either will work. (As will escaping the pipe, though that's a little less clear to someone reading the line.)
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    1. Here, the word "DO" (... /P) is blue, but it's not underlined and clicking it does nothing.
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    Here, /P is blue and underlined and clicking on it takes me to the /P description.
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    Not here.
    upload_2016-7-3_12-47-37.png
     
  6. Alpengreis

    Joined:
    Jan 12, 2014
    Messages:
    229
    Likes Received:
    6
    And not here ...
     

Share This Page