The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running UNIX in windows environment ? bh_hensem Windows & DOS: Issues & Discussions 1 05-10-2007 04:25 PM
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 02:24 AM
Running MS-windows GUI from unix/linux koreng UNIX Desktop for Dummies Questions & Answers 1 11-13-2005 05:12 AM
Running windows command from Unix Sabari Nath S Shell Programming and Scripting 4 09-16-2005 07:55 AM
Running windows command from Unix Sabari Nath S UNIX for Advanced & Expert Users 1 09-07-2005 12:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2005
Registered User
 

Join Date: Mar 2005
Location: England
Posts: 16
Stumble this Post!
Running a UNIX command from Windows

Hi

I need to run a UNIX command from Visual C++ Windows program.

I was thinking of the Windows program generating a dummy file on the UNIX drive. On the UNIX box I could have a simple FORTRAN porogram searching continually for this dummy file and executes the UNIX command when the file exists.

However, this procedure is hardly elegant and was hoping someone out there has a better way of doing it?

Furthermore, I need a way of telling the Windows program the UNIX command has finished. Again, I could use a similar approach but would prefer a more elegant way of doing this!

** EXTRA INFORMATION **
The PC I use accesses a UNIX server over the network via Exceed and has SAMBA installed so Windows can see the UNIX drives.
The Windows program has been made using Visual C++ 6
The UNIX box is running Solaris (v8 I think)

Thanks for reading this thread

Last edited by robbiegregg; 03-20-2005 at 07:28 AM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-20-2005
Registered User
 

Join Date: Mar 2005
Posts: 53
Stumble this Post!
i think you need to run a service on the unix computer running on some port and write a client on windows to connect to it. i think its a security problem if you allow client to issue any commands so you have to know what you want exactly from the server.

for example this service using gawk gives out time to clients that connect to port 8888 similar to daytime:

Code:
BEGIN {
  print strftime() |& "/inet/tcp/8888/0/0"
  close("/inet/tcp/8888/0/0")
}

example client (gawk)
Code:
BEGIN {
  "/inet/tcp/0/localhost/8888" |& getline
  print $0
  close("/inet/tcp/0/localhost/8888")
}
Reply With Quote
  #3 (permalink)  
Old 03-20-2005
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Stumble this Post!
You could add an ssh api to your windows C++ codebase, and execute the commands that way.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0