top | item 41899184

(no title)

pbaam | 1 year ago

The cat command can be omitted there, as tee reads from standard input by default, even if stdin points to a terminal. I was going to comment an actually useful (and unavoidable in bash) use of cat and ssh, which is to do do nothing with standard input and redirect it to a file:

  <file ssh 'cat >file'
And you could just use scp, but I've found clients without scp and servers with the SFTP subsystem disabled.

discuss

order

x3n0ph3n3|1 year ago

I want do paste from my clipboard, not copy another file.

pbaam|1 year ago

I know, it's intentionally unrelated. But if you read my first sentence, you can do what you are interested in without using cat.

  sudo tee somefile > /dev/null
And you will be able to paste from your clipboard or write anything you want. Without cat or piping.