>> Append File

Writes stdin to disk - appending contents if file already exists

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) token 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

Syntactic Sugar

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

out "foobar" >> example.txt

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

out "foobar" | >> example.txt

Truncating A File

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

Synonyms

See Also


This document was generated from builtins/core/io/write_doc.yaml.

This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.

Last built on Tue Dec 10 22:56:57 UTC 2024 against commit 60f05a260f05a227caf73dd5b3478e3cb3f4bb24e46745b.

Current version is 6.4.1005 (develop) which has been verified against tests cases.