Below is the script I am trying to execute to rename a file in an SFTP session.
It is in GNU/Linux.
This script is for generic use and so I am passing arguments. Everything in the script works fine except "reading the filename in SFTP session"
In the below script the $Remote_server_source_path is read properly. The filename is read from the while loop. When i echo the filename, it is read correctly, but somehow it is not read in sftp session
Please help!!
---------- Post updated at 09:08 AM ---------- Previous update was at 09:07 AM ----------
I also tried removing the qoutes . It still doesnt work.
We used to have a ftp user id with no telnet session allowed in server side.
We used this ftp user id in script by transferring file from client to Server.
Currently we need to implement sftp to replace ftp.
We have tested few round and working fine by using sftp with normal user id (allow... (2 Replies)
After running he following command to rename a file:
# mv 'Linux CPU (EDF).sh' LinuxCpu(EDF).sh
I am getting the following error:
-bash: syntax error near unexpected token `('
Why is this happening? (2 Replies)
We have script running to SFTP some file to the remote server. The problem is the SFTP transfer returns an exit code of 0 even if there is permission error during file transfer, connection refuse (like when sftp server is down), thus, returning the status of the script as success.
I was thinking... (3 Replies)
Hi,
i got the following error when i tried to access the cygwin x server from a windows XP PC.
"xdmcp fatal error session failed session 23 failed for display"
Alternatively, when i tried to access the same Cygwin X Server from another windows XP PC which is on a different LAN... (3 Replies)
Hi all ,
can any one tell me how to run a script within a sftp session. let me tell u in bit clear way :
After I connected to sftp location , cd ing to some directory then I need to execute a one script. Please tell me if u have any idea on this .
Looking forward to your reply guys... (1 Reply)
Hi All,
I have a script which works perfectly for using SFTP commands.
I use SFTP -b batchfile remoteuser@remoteserver.
This batch file contains a command
cd /dir1
put file1
I am wondering if there is a flag to rename a file on Remote server.
I see the option
rename file1... (6 Replies)
Hi,
Am using sftp (dsa method) to transfer 20 files from one server(sftp) to another (local). After the transfer is complete the files in the sftp server has to be renamed from .txt extension to .done extension ( aa.txt to aa.done, bb.txt to bb.done and likewise...).
I tried rename command... (4 Replies)
Hi Admins,
I am trying to get a file with different name including date format using sftp.
For example --> get test.bak auto`date +"%Y%m%d"`err
Here i am trying to get the file test.back with name auto20120126err
But file is copied with the name auto`date --> date is not printing... (1 Reply)
Hi,
I am trying to create more than one directory by using -p option in SFTP session.
But it created a directory named -p and ended.
It didn't throw any error.
sxxxxxxx:(abc)/test> sftp abcuser@zxxxxxxx
Connecting to zxxxxxxx...
Password:
sftp> pwd
Remote working directory: /test... (3 Replies)
I have a .ksh script that creates an sftp batch file and runs it through sftp. It works except for one thing. If I try to "put" to a different name, it doesn't use the specified remote name...it still "puts" the original local name.
I've tried both of these, and neither work...it will always... (4 Replies)
Discussion started by: dbiggied
4 Replies
LEARN ABOUT OPENDARWIN
script
SCRIPT(1) BSD General Commands Manual SCRIPT(1)NAME
script -- make typescript of terminal session
SYNOPSIS
script [-a] [-k] [-q] [-t time] [file [command ...]]
DESCRIPTION
The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an
interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.
If the argument command ... is given, script will run the specified command with an optional argument vector instead of an interactive shell.
Options:
-a Append the output to file or typescript, retaining the prior contents.
-k Log keys sent to program as well as output.
-q Run in quiet mode, omit the start and stop status messages.
-t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The
default interval is 30 seconds.
The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if
ignoreeof is not set) for the C-shell, csh(1)).
Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not
manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one.
ENVIRONMENT
The following environment variable is utilized by script:
SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most
shells set this variable automatically).
SEE ALSO csh(1) (for the history mechanism).
HISTORY
The script command appeared in 3.0BSD.
BUGS
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects.
It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues.
When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual
echo logging. This does not work when in a raw mode where the program being run is doing manual echo.
BSD June 6, 1993 BSD