Unix/Linux Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

Ftp command nlist not supporting in sftp

HP-UX


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-01-2017   -   Original Discussion by Pelins
Pelins Pelins is offline
Registered User
 
Join Date: May 2017
Last Activity: 7 May 2017, 10:57 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Ftp command nlist not supporting in sftp

Hi,

We are using HP-UX. Previously we were using ftp to connect to remote list the text file name and copy into local file with .ls extension. For this we are using
Code:
nlist RBOBAR*.txt DMSFT.ls

now we want to convert the integration with sftp. So In sftp nlist command is not supported. How can we write a script to copy the remote file name lists to local directory into the file in sftp. Can anyone help me to solve the concern . Thanking you advance.

Last edited by jim mcnamara; 05-01-2017 at 12:34 PM.. Reason: code tags
Sponsored Links
    #2  
Old Unix and Linux 05-01-2017   -   Original Discussion by Pelins
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 18 November 2017, 3:16 PM EST
Location: NM
Posts: 11,239
Thanks: 570
Thanked 1,116 Times in 1,030 Posts
The nlist ftp command in sftp is ls

Some sftp servers support dir

So, change nlist to ls
Sponsored Links
    #3  
Old Unix and Linux 05-02-2017   -   Original Discussion by Pelins
Pelins Pelins is offline
Registered User
 
Join Date: May 2017
Last Activity: 7 May 2017, 10:57 PM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jim mcnamara View Post
The nlist ftp command in sftp is ls

Some sftp servers support dir

So, change nlist to ls

Hi Jim,

Thanks for your reply...

I have used ls in script instead of nlist. But it only lists the file. My requirement is to copy the name of file listed to a local file through sftp.
    #4  
Old Unix and Linux 05-02-2017   -   Original Discussion by Pelins
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 17 November 2017, 9:25 PM EST
Location: Saskatchewan
Posts: 22,512
Thanks: 1,151
Thanked 4,273 Times in 3,946 Posts
sftp does not have this command or anything like it. You will have to capture sftp's output and process it.
Sponsored Links
    #5  
Old Unix and Linux 05-02-2017   -   Original Discussion by Pelins
vgersh99's Unix or Linux Image
vgersh99 vgersh99 is offline Forum Advisor  
Forum Advisor
 
Join Date: Feb 2005
Last Activity: 18 November 2017, 4:53 PM EST
Location: Foxborough, MA
Posts: 8,201
Thanks: 231
Thanked 785 Times in 732 Posts
wouldn't sftp's get with wildcard do the trick?
Sponsored Links
    #6  
Old Unix and Linux 05-02-2017   -   Original Discussion by Pelins
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 17 November 2017, 9:25 PM EST
Location: Saskatchewan
Posts: 22,512
Thanks: 1,151
Thanked 4,273 Times in 3,946 Posts
Depends on what he's trying to do. If in the end all he needs to do is retrieve a list of files matching wildcards, mget will do.
Sponsored Links
    #7  
Old Unix and Linux 05-02-2017   -   Original Discussion by Pelins
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 18 November 2017, 3:16 PM EST
Location: NM
Posts: 11,239
Thanks: 570
Thanked 1,116 Times in 1,030 Posts

Code:
sftp me@anothercomputer <<! > listoffilenames.txt
cd /path/to/files
ls RBOBAR*.txt DMSFT.ls
!
# want to see what you got? add this line
cat listoffilenames.txt

Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Supporting NIC speed solaris_1977 Solaris 7 12-13-2012 10:51 AM
SFTP-how to log individual sftp command error while executing shell script noobrobot Shell Programming and Scripting 1 10-09-2011 08:17 PM
Supporting Others' Scripts Vi-Curious Shell Programming and Scripting 2 04-08-2011 05:26 PM
tool supporting SPL vijaya2006 HP-UX 0 07-31-2006 06:34 AM
Issue with AIX 5.3 and nlist/nlist64/knlist lawrence AIX 0 03-03-2005 03:19 PM



All times are GMT -4. The time now is 07:07 PM.