![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| fork and exec ftp | KittyJ | SUN Solaris | 2 | 08-10-2007 07:55 AM |
| fork/exec clobbers write. I need ideas why... | frequency8 | High Level Programming | 7 | 05-29-2007 01:34 AM |
| FORK/EXEC technique | marshmallow | UNIX for Dummies Questions & Answers | 4 | 01-18-2007 10:12 PM |
| rc=127 can't fork | BG_JrAdmin | Shell Programming and Scripting | 1 | 08-01-2006 06:30 PM |
| Fork and exec | driki | High Level Programming | 3 | 05-21-2002 11:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I need to ssh to a remote server and run my script there. This is my script.
$ssh = "ssh username@host"; $cmd = "$ssh 'cd <my dir> && < sudo Run_exe>'"; my $pid = fork; if ($pid == 0){ exec $cmd; } When I run this I get: pccons_getchar: got r == 0 Last edited by looza; 07-17-2008 at 11:16 PM.. |
|
||||
|
assuming perl........
not sure if this is the source of your problem, but the @ symbol is being interpolated as an array because you have it inside a double-quoted string, use single-quotes: $ssh = 'ssh username@host'; also, when you use exec in perl it does not return back to the perl script, although I am not sure what happens when you run it in a forked process. Try system() or qx//. qx// returns process output back, system() does not. Look them up in the perl documentation. Next time put Perl in your subject line if that is what you are using. fork and exec : Perl |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|