Skip to main content

>> Append Pipe

Laurence MorganLess than 1 minute

>> Append Pipe

Redirects STDOUT to a file and append its contents

Description

This is used to redirect the STDOUT of a command and append it to a file. If that file does not exist, then the file is created.

This behaves similarly to the Bash (et al) tokenopen in new window except it doesn't support adding alternative file descriptor numbers. Instead you will need to use named pipes to achieve the same effect in Murex.

Examples

» out "Hello" >> example.txt
» out "World!" >> example.txt
» open example.txt
Hello
World!

Detail

This is just syntactic sugar for -> >>. Thus when the parser reads code like the following:

echo "foobar" >> example.txt

it will compile an abstract syntax tree which would reflect the following code instead:

echo "foobar" | >> example.txt

Truncating a file

To truncate a file (ie overwrite its contents) use |> instead.

See Also

  • Pipeline: Overview of what a "pipeline" is
  • -> Arrow Pipe: Pipes STDOUT from the left hand command to STDIN of the right hand command
  • <pipe> Read Named Pipe: Reads from a Murex named pipe
  • >> Append File: Writes STDIN to disk - appending contents if file already exists
  • ? STDERR Pipe: Pipes STDERR from the left hand command to STDIN of the right hand command (DEPRECATED)
  • ja (mkarray): A sophisticated yet simply way to build a JSON array
  • |> Truncate File: Writes STDIN to disk - overwriting contents if file already exists
  • | POSIX Pipe: Pipes STDOUT from the left hand command to STDIN of the right hand command

This document was generated from gen/parser/pipes_doc.yamlopen in new window.

Last update:
Contributors: Laurence Morgan