coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use tq instead of tee: Add -q, --quiet option to not write to stdout


From: L A Walsh
Subject: Use tq instead of tee: Add -q, --quiet option to not write to stdout
Date: Sun, 24 Jan 2021 23:19:54 -0800
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

On 2021/01/21 05:17, Alejandro Colomar wrote:
This is useful for using tee to just write to a file,
at the end of a pipeline,
without having to redirect to /dev/null
Example:
echo 'foo' | sudo tee -q /etc/foo;
---
   Isn't this what you want and shorter?:

echo 'foo' | sudo tq /etc/foo
 ls -l /etc/foo
-rw-rw-r-- 1 root root 4 Jan 24 23:17 /etc/foo

 cat tq
#!/bin/bash
command tee "$@" >/dev/null


It would have the advantage of working  with any
coreutils implementation.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]