Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
what i'd like to do is put the output from a command that continuously loops into a file on the same server i ssh into. for example i'm on server1 and ssh to server2
now if i do this,
ssh user@server2 echo "Hello" > /file.txt
then the file.txt is saved to server one and i want the output to stay on server2, and no, copying it over isn't an option as i'm really trying to get it to work with the nohup command.
As when the connection to the /dev/null is lost the process stops working as well, thats why i want the output to be going to the same server (server2) that i'm trying to get this command to run on.
not sure how to do it i did something like //servername/target but that didn't work at all
Anyideas, maybe just how to get the echo to output to the server2 when running the command on server2 would be a start
thanks but nope i've tried that already
although i used ` and not '
i thought ' was primarily to show text strings rather like ", i'll give it a whirl
thanks and i'll write back
Quoting in the shell can get a bit weird. Basically:
"" = treat the quoted contents as one object, and allow shell expansion ($HOME becomes /home/username, for example)
'' = treat the quoted contents as one object, with no shell expansion ($HOME would be passed as a literal $HOME string)
`` = run the quoted contents as a shell command, and replace the quote with the output from that command
(Sorry if that was a bit patronising, but maybe it'll be of use to googlers later).
sorry didn't see you second post due to testing out what you had put, i just want to say i could kiss you right now
Yes that worked great, its sorted out a problem i was having with the nohup command. i was ssh-ing into another server and trying to run a process with the nohup which should say running constantly, but when i closed the ssh it closed the session and because the other server was obviously trying to get to this servers /dev/null and couldn't therefore it closed the process. But i didn't know how to make output targets when using them remotley output to that same server and not the one i was using to ssh with, your echo stuff showed me it was possible i did the same with my nohup command and it worked fantastic.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.