FAQ Database Discussion Community


>(tee -a …) command in bash

bash,unix,tee
I have this bash code that runs Scala test code: scripts=( Hello.scala ) for script in "${scripts[@]}"; do echo scala "${script}" scala -nocompdaemon "${script}" > >(tee -a _testoutput.txt) \ 2> >(tee -a _testerrors.txt >&2) done How to interpret >(tee -a _testoutput.txt)? I normally use | (pipe) for using tee, what's...

creating a tarball, encrypt it on the fly and keeps tar messages in a log file

bash,shell,tar,gnupg,tee
On OSX I'm trying to create a tarball of a directory and on the fly encrypt it with gpg and keeps the output of the tar messages in a log file for later analysis. While the tar+gpg on the fly it's pretty easy tar zcvf - foo | gpg -e...

cat /dev/null to multiple files to clear existing files like logs

linux,bash,shell,command-line,tee
A good way to clear logs(syslog has a handle on file) which have frozen my linux server(out of space) I tried cat /dev/null > fileABC; cat /dev/null/ > fileXYZ How can I clear multiple files by cat /dev/null to multiple files in an efficient or single command. ...

tee with utf-8 encoding

powershell,encoding,tee,powershell-v4.0
I'm trying to tee a server's output to both the console and a file in Powershell 4. The file is ending up with a UTF-16 encoding, which is incompatible with some other tools I'm using. According to help tee -full: Tee-Object uses Unicode enocding when it writes to files. ......