GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STRING-COLLECT(1) fish-shell STRING-COLLECT(1)

string-collect - join strings into one

string collect [(-N | --no-trim-newlines)] [STRING...]


string collect collects its input into a single output argument, without splitting the output when used in a command substitution. This is useful when trying to collect multiline output from another command into a variable. Exit status: 0 if any output argument is non-empty, or 1 otherwise.

If invoked with multiple arguments instead of input, string collect preserves each argument separately, where the number of output arguments is equal to the number of arguments given to string collect.

Any trailing newlines on the input are trimmed, just as with "$(cmd)" substitution in sh. --no-trim-newlines can be used to disable this behavior, which may be useful when running a command such as set contents (cat filename | string collect -N).

>_ echo \"(echo one\ntwo\nthree | string collect)\"
"one
two
three"
>_ echo \"(echo one\ntwo\nthree | string collect -N)\"
"one
two
three
"


2021, fish-shell developers
April 9, 2022 3.3

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.