Colin,
Give the full path to the file you wish to write to also it is recommended you add perl interpreter with the shebang on the first line.
See below:
Code:
#!/usr/bin/perl
open FILE, ">/tmp/file.txt" or die $!;
print FILE "Testing123\n";
close FILE;
Hi,
I have a script (a.pl) that can be run by anyone. The script internally has to read a file and write into few files which are owned by user 'myUser'.
Has to read the following file:
-rwx------ 1 myuser myuser 4986 Aug 20 18:11 my.file
Has to write into following files:
... (0 Replies)
Hello people,
I am want to run a server on remote machine through perl scripting using telnet api. Now when I try to do so, the server gets started perfectly, but as soon as I close the telnet connection in the script, the server started on the remote machine suddenly goes down. I also... (0 Replies)
hi
i am having two servers one is local and remote(FTP)server.from local server i have to connect to remote server and execute a shell script
i want to run a shell script(remote location) from my local server
i am having some knowledge on ftp but i am not getting the result .please give ... (2 Replies)
Hi Guru,
I have a requirement where i need to list the *.csv files in my remote server
and copy a file from that server to my unix server
I wrote dis code
#!/bin/sh
. /home/aaa/bb/GlobalHost.sh
export HOST
export USER
export PWD
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote... (1 Reply)
Hi All,
This Monday 15th March 2010, i have faced a weired issue with my Perl script execution, this script is scheduled to run at 1 minute past midnight on daily basis ( 00:01 EST ) generally for fetching previous business date , say if it is Monday it should give last Friday date, for Tuesday... (0 Replies)
Hi
I am trying to edit a text file on a remote server using sed from within a cygwin shell on a windows system.
$ sed -i "s/aaa/bbb/g" \\remoteHost\c$\log.info
sed: can't read \remoteHostc$log.info: No such file or directory
What am I missing ?
Thanks. (7 Replies)
I have a command that I want to run on machine B from machine A. If I run the command on machine B locally, it works fine.
Here is the command:
for n in `find /data1/ -name 'ini*.ext'` ; do echo cp $n "`dirname $n `/` basename $n
.ext`"; done
From machine A, I issue this command ... (3 Replies)
Hi All,
I have 2 servers A and B. I need to connect to server B from server A and execute a shell script in B which will create some files and i need to copy those files back to server A.
Required easiest possible for perfoming above task. (1 Reply)
I'm having a brain freeze moment. I've created a ksh script in AIX that ssh's to a remote server, executes some commands, and then logs out. All of this is sent to a file. I then have the script cat the file so i can see the output. Even though the cat command is outside of the remote session part;... (5 Replies)
i have a "if .. then exit end " in s shell script on remote servers.
now the connection to the remote server got killed after i run this script on the remote servers. How do i run this script on remote hosts and still keep remote connections alive after executing the script.
Thank you. (10 Replies)
Discussion started by: moonmonk
10 Replies
LEARN ABOUT MOJAVE
tcl_getopenfile
Tcl_GetOpenFile(3) Tcl Library Procedures Tcl_GetOpenFile(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_GetOpenFile - Return a FILE* for a channel registered in the given interpreter (Unix only)
SYNOPSIS
#include <tcl.h>
int
Tcl_GetOpenFile(interp, chanID, write, checkUsage, filePtr)
ARGUMENTS
Tcl_Interp *interp (in) Tcl interpreter from which file handle is to be obtained.
const char *chanID (in) String identifying channel, such as stdin or file4.
int write (in) Non-zero means the file will be used for writing, zero means it will be used for reading.
int checkUsage (in) If non-zero, then an error will be generated if the file was not opened for the access indicated by
write.
ClientData *filePtr (out) Points to word in which to store pointer to FILE structure for the file given by chanID.
_________________________________________________________________DESCRIPTION
Tcl_GetOpenFile takes as argument a file identifier of the form returned by the open command and returns at *filePtr a pointer to the FILE
structure for the file. The write argument indicates whether the FILE pointer will be used for reading or writing. In some cases, such as
a channel that connects to a pipeline of subprocesses, different FILE pointers will be returned for reading and writing. Tcl_GetOpenFile
normally returns TCL_OK. If an error occurs in Tcl_GetOpenFile (e.g. chanID did not make any sense or checkUsage was set and the file was
not opened for the access specified by write) then TCL_ERROR is returned and the interpreter's result will contain an error message. In
the current implementation checkUsage is ignored and consistency checks are always performed.
Note that this interface is only supported on the Unix platform.
KEYWORDS
channel, file handle, permissions, pipeline, read, write
Tcl 8.0 Tcl_GetOpenFile(3)