Answer the question
In order to leave comments, you need to log in
How to redirect the output of a command to a file?
screen -d -m -S session ping 192.168.1.1 -c 10 >~/file &
This doesn't work.
Although if you just ping 192.168.1.1 -c 10 >~/file & then the redirection works.
I tried to crutch like this
screen -d -m -S session ~/run.sh
the script itself run.sh
#!/bin/bash
$1 >~/buffer
and, accordingly, if called from the console as
./run.sh '192.168.1.1 - c 10' it works as it should
, but if you call the command from screen in general, then
screen -d -m -S session ~/run.sh '192.168.1.1 -c 10' does not work again,
since the parameter that I pass to run.sh not getting through.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question