Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Echo For ... Loop output into a file Post 303041866 by duke0001 on Thursday 5th of December 2019 01:05:15 PM
Old 12-05-2019
RudiC:

Thanks for advice. I have tried that and many other things such as taking off double quote, using single quote and so on. It all didn't work. This rename statement is to use to rename files on remote SFTP server. Due to command available on FTP server is limited. I want to generate this rename statement and call from SFTP to reach my goal. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh script that echo " please insert your name " and store the output to a login.log file.

Hello All Nice to meet you all here in this forum, it's my 1rst time here i'm asking about a little issue that i face i added a ksh script that echo " please insert your name " and store the output to a login.log file. the script is working fine with normal telnet but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies

2. Shell Programming and Scripting

problem with suppressed output to file using echo and tee command

Hi, When I run the following command in terminal it works. The string TEST is appended to a file silently. echo TEST | tee -a file.txt &>/dev/null However, when I paste this same line to a file, say shell1.sh, and use bourne shell . I run this file in terminal, ./shell1.sh. However I... (1 Reply)
Discussion started by: shahanali
1 Replies

3. Shell Programming and Scripting

Script to loop line in a file and add info or do echo

I have a record.txt it will update weekly, and it could be 2 lines or more ... it just echo each line to the script san jose,23.34% tampa,2.15% dallas,30.20% seattle,44.29% Unknown,16.72% How do i write a shell script to give me a test.pl or bash file which contain #!/home/perl... (8 Replies)
Discussion started by: sabercats
8 Replies

4. Homework & Coursework Questions

Loop to Convert a list from an input file and output it to another file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: A) Write a script, which will take input from a file and convert the number from Centigrade to Fahrenheit... (5 Replies)
Discussion started by: AliTheSnake
5 Replies

5. UNIX for Dummies Questions & Answers

Redirect output of echo to a file

Hi , I am trying to redirect output of echo to a file.So i wrote a function named printline.Here is my sample script myscript.sh function printline() { echo "$1" >> myfile.log } usage() { printLine "********************USAGE*************************" printLine "Script takes... (12 Replies)
Discussion started by: ASC
12 Replies

6. Shell Programming and Scripting

Echo prompt and redirecting the output to a file

Hi Help, I have a script which looks like below. echo "Train count??" set train_count = $< cat tmp | awk -v var=${train_count} '{print $0"var"}' > tmp The echo "Train Count??" does not show up in the terminal due to redirecting to output file tmp. How is it possible to have the prompt... (3 Replies)
Discussion started by: Indra2011
3 Replies

7. Shell Programming and Scripting

How to read each line from input file, assign variables, and echo to output file?

I've got a file that looks like this (spaces before first entries intentional): 12345650-000005000GL140227 ANNUAL HELC FEE EN 22345650-000005000GL140227 ANNUAL HELC FEE EN 32345650-000005000GL140227 ANNUAL HELC FEE EN I want to read through the file line by line,... (6 Replies)
Discussion started by: Scottie1954
6 Replies

8. Shell Programming and Scripting

BASH - Need to echo for loop output to one line

I'm trying to echo the release version of some of our Linux servers. Typically I do these types of things by "catting" a text file with the host names, "ssh-ing" to the host and running my string. This is what I've written for i in `cat versions.txt` ; do echo $i ; ssh $i cat /etc/issue |... (5 Replies)
Discussion started by: lombardi4851
5 Replies

9. UNIX for Beginners Questions & Answers

Need to save output of echo and awk to a file

Hi, I am generating a YAML file from a hosts file, but am having trouble saving it to a new file. hosts file 127.0.0.1 localhost 192.168.1.2 host1 192.168.1.3 host2 192.168.1.4 host3 192.168.1.5 host4 YAML file $ echo 'host_entries:' && awk '{printf " %s:\n ip:... (3 Replies)
Discussion started by: sand1234
3 Replies

10. UNIX for Beginners Questions & Answers

For loop output to excel file

Hi, I have a shell script which analyses the log folder for a specific string and throws me the output. I have used for loop since it does this in multiple servers. Now I want to save the output in a excel in the below format. Can someone please help? The output which I get Server1 : count... (1 Reply)
Discussion started by: srilaxman
1 Replies
Net::SSH2::SFTP(3pm)					User Contributed Perl Documentation				      Net::SSH2::SFTP(3pm)

NAME
Net::SSH2::SFTP - SSH 2 Secure FTP object DESCRIPTION
An SFTP object is created by the Net::SSH2 "sftp" method. error Returns the last SFTP error (one of the LIBSSH2_FX_* constants). Use this when Net::SSH2::error returns LIBSSH2_ERROR_SFTP_PROTOCOL. In list context, returns (code, error name). open ( file [, flags [, mode ]]] ) Open or create a file on the remote host. The flags are the standard O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, and O_EXCL, which may be combined as usual. Flags default to O_RDONLY and mode to 0666 (create only). Returns a Net::SSH2::File object on success. opendir ( dir ) Open a directory on the remote host; returns a Net::SSH2::Dir object on success. unlink ( file ) Delete the remote file. rename ( old, new [, flags ] ) Rename old to new. Flags are taken from LIBSSH2_SFTP_RENAME_*, and may be combined; the default is to use all (overwrite, atomic, native). mkdir ( path [, mode ] ) Create directory; mode defaults to 0777. rmdir ( path ) Remove directory. stat ( path [, follow ] ) Get file attributes for the given path. If follow is set (default), will follow symbolic links. On success, returns a hash containing the following: mode size uid gid atime mtime setstat ( path, key, value... ) Set file attributes for given path; keys are the same as those returned by stat; note that it's not necessary to pass them all. symlink ( path, target [, type ] ) Create a symbolic link to a given target. readlink ( path ) Return the target of the given link, undef on failure. realpath ( path ) Resolve a filename's path; returns the resolved path, or undef on error. SEE ALSO
Net::SSH2. AUTHOR
David B. Robins, <dbrobins@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2005, 2006 by David B. Robins; all rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2011-05-06 Net::SSH2::SFTP(3pm)
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy