LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   executing linux command over a network!!!! (https://www.linuxquestions.org/questions/linux-newbie-8/executing-linux-command-over-a-network-824562/)

vaalu 08-06-2010 06:39 AM

executing linux command over a network!!!!
 
hi all,

I have a some c source code files that i have to copy to linux machine from a windows machine over a network. This source code folder has to be copied into a particular directory structure in the linux system at the other end. After copying the file into the appropriate folder in the linux server i have to instruct the linux machine to make(using the make file that is there with the c files) this source code from the windows machine. Does anyone have any idea in regard to how this can be implemented?? i am trying to have a gui client that has the above mentioned options(copying and inserting the c files into the appropriate directory and then for making the files and getting the executable.) But i have no idea whether this can be achieved or not or where to start to implement this. Could any one help in regard to this???

Thanking you in anticipation...

tronayne 08-06-2010 06:51 AM

The easiest way to do this is to install PuTTY on the Windows box (see http://www.chiark.greenend.org.uk/~s.../download.html). You do not need to install anything on the Linux side, it will already be there.

What that does is lets you connect to your Linux machine, transfer files and directories back and forth (you would probably want to use scp, secure copy (remote file copy program). You would then be able to use ssh, OpenSSH SSH client (remote login program) to do the work on the Linux machine from a terminal window on the Windows machine.

This is a pretty common way to get Linux connectivity from Windows.

Hope this helps some.

CincinnatiKid 08-06-2010 06:54 AM

If you have to do the copying from the Windows machine to the Linux machine, I would probably just use FTP, but I'm sure there are other methods. Then I would use Putty or something similar to SSH into your Linux box to run whatever commands you need to run.

jschiwal 08-06-2010 07:09 AM

Another option to transfer the files is to copy them to a network share, and then ssh into the Linux machine, and from there copy them from the share. If the destination on the Linux host is shared (using samba) you could use explorer to copy the files as you normally would.
---
Windows text files contain CRLF pairs at the end of lines instead of \n. That can cause problems in Linux. One example is Make files. Another example is bash scripts. If you don't realize the source of the files, it is a hard problem to find, because these characters are invisible. If these files were created in Windows, you will need to remove the \r character. The linux host probably has a program installed that can do this called dos2unix.

dos2unix filename

If not you can use the sed command to remove them:
sed -i 's/\r//g' filename
the filename(s) can contain wildcard to convert several files at once:
sed -i 's/\r//g' *.c *.h

You can check if a file has this problem using the file command:
file filename
If is says ASCII text, it is OK. If it says ASCII text with CRLF pairs.


All times are GMT -5. The time now is 02:53 AM.