Skip to content
Advertisement

Tag: unix

How to download a file from server using SSH? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Closed 10 years ago. Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. I need to download a file from server to my desktop. (UBUNTU 10.04) I don’t have a web access

Adding newline characters to unix shell variables

I have a variable in a shell script in which I’d like to format the data. The variable stores new data during every iteration of a loop. Each time the new data is stored, I’d like to insert a new line character. Here is how I’m trying to store the data into the variable. VARIABLE=”$VARIABLE ‘n’ SomeData” Unfortunately, the output

Run a persistent process via ssh

I’m trying to start a test server via ssh but it always dies once i disconnect from ssh. Is there a way to start a process (run the server) so it doesn’t die upon the end of my ssh session? Answer As an alternative to nohup, you could run your remote application inside a terminal multiplexor, such as GNU screen

Run Another Program in Linux from a C++ Program

Okay so my question is this. Say I have a simple C++ code: Now say I have this program that I would like to run in my program, call it prog. Running this in the terminal could be done by: Is there a way to just do this from my simple C++ program? For instance Any feedback would be very

Re-opening stdout and stdin file descriptors after closing them

I’m writing a function, which, given an argument, will either redirect the stdout to a file or read the stdin from a file. To do this I close the file descriptor associated with the stdout or stdin, so that when I open the file it opens under the descriptor that I just closed. This works, but the problem is that

What is a .pid file and what does it contain?

I recently come across a file with the extension .pid and explored inside it but didn’t find much. The documentation says: A Pid-File is a file containing the process identification number (pid) that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid of a running script. Can anyone shed more light

Concatenating Files And Insert New Line In Between Files

I have multiple files which I want to concat with cat. Let’s say I want to concat so that the final file looks like: Instead of this with usual cat File*.txt > finalfile.txt What’s the right way to do it? Answer You can do: Make sure the file finalfile.txt does not exist before you run the above command. If you

Advertisement