02-21-2019, 03:07 PM
(This post was last modified: 02-21-2019, 03:12 PM by Zamujasa. Edited 1 time in total.)
Generally, "^" is the "append to file" operator (like ">" in Linux).
You can use it to create multi-line files:
You can also do that with |n, but it can get a bit ugly in some cases:
However, it seems that if you try appending to a program like this, it runs the program instead of running the command and appending it:
Also, echo's help topic suggests you can try piping, but it doesn't seem to work at all:
You can use it to create multi-line files:
Code:
>echo line 1 ^ test
>echo line 2 ^ test
>cat test
]line 1
]line 2
]
You can also do that with |n, but it can get a bit ugly in some cases:
Code:
>echo line 1|nline 2 ^ test2
>cat test2
]line 1
]line 2
]
However, it seems that if you try appending to a program like this, it runs the program instead of running the command and appending it:
Code:
>echo #! ^ test3
>echo echo test 1 ^ test3
>echo echo test 2 ^ test3
]test 1
]
>cat test3
]#!
]echo test 1
]
Also, echo's help topic suggests you can try piping, but it doesn't seem to work at all:
Code:
>cat out
]~
]
>echo "this is some words" | out
]Unable to pipe stream to file.
>man echo
]Echo: Print text to current stream. Stream defaults to standard output (User terminal screen) if not piping.
]If piping, output is passed on. If the piping target is not an executable, an attempt will be made to write to that file.
]Usage: echo "text" OR echo "text" | pipe_file_name