Find the answer to your Linux question:
Results 1 to 3 of 3
Hey, I have some command, I'll call it "command". I need to do this: yes | command but without a pipe, there is a reason for this, because for the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    2

    Pipe alternative


    Hey,

    I have some command, I'll call it "command".

    I need to do this:
    yes | command
    but without a pipe, there is a reason for this, because for the specific use, pipe before the command
    is not allowed, that's not the point.

    Is there an alternative I can use which will output do the same thing without the pipe ?
    Maybe something like this:
    command < yes
    (which will not work because it expects a file, and not a command)
    ?

    Or some other simple way ?

    Thanks

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    848
    You can use subshell:

    For example to create a file using the result from echo:

    Code:
    touch <(echo "test.txt")
    For more information see command_liners | An alternative to the pipe (in bash/ksh)
    Linux User #453176

  3. #3
    Just Joined!
    Join Date
    Feb 2013
    Posts
    2
    Yes I saw that, thanks.

  4. $spacer_open
    $spacer_close

Posting Permissions

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