wjtk
wjtk

Reputation: 1247

redirecting stdout within screen command

I want to redirect stdout and run command in screen. For example I have simple command:

echo yo | tee yo.log

and now I want to run it within screen:

screen -dmS screenName echo yo | tee yo.log

which doesn't work because pipe will redirect screen output, not my command(echo). How can I fix it to see in my file output of echo?

Upvotes: 2

Views: 3226

Answers (1)

mschuurmans
mschuurmans

Reputation: 1086

Try:

screen -dm bash -c "echo yo | tee yo.log"

Found on this thread

Upvotes: 5

Related Questions