×
UNIX.COM Login
Username:
Password:  
Show Password






👤


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

👤 Login to reply

 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-01-2017
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 11:34 AM.. Reason: code tags
Sponsored Links
    #2  
Old 05-01-2017
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 July 2018, 10:19 PM EDT
Location: NM
Posts: 11,435
Thanks: 636
Thanked 1,174 Times in 1,081 Posts
The nlist ftp command in sftp is ls

Some sftp servers support dir

So, change nlist to ls
Sponsored Links
    #3  
Old 05-02-2017
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 05-02-2017
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 July 2018, 1:06 PM EDT
Location: Saskatchewan
Posts: 22,722
Thanks: 1,192
Thanked 4,347 Times in 4,003 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 05-02-2017
vgersh99's Unix or Linux Image
vgersh99 vgersh99 is offline Forum Advisor  
Forum Advisor
 
Join Date: Feb 2005
Last Activity: 16 July 2018, 6:49 AM EDT
Location: Foxborough, MA
Posts: 8,306
Thanks: 255
Thanked 837 Times in 781 Posts
wouldn't sftp's get with wildcard do the trick?
Sponsored Links
    #6  
Old 05-02-2017
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 13 July 2018, 1:06 PM EDT
Location: Saskatchewan
Posts: 22,722
Thanks: 1,192
Thanked 4,347 Times in 4,003 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 05-02-2017
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 15 July 2018, 10:19 PM EDT
Location: NM
Posts: 11,435
Thanks: 636
Thanked 1,174 Times in 1,081 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
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:51 AM
SFTP-how to log individual sftp command error while executing shell script noobrobot Shell Programming and Scripting 1 10-09-2011 07:17 PM
Supporting Others' Scripts Vi-Curious Shell Programming and Scripting 2 04-08-2011 04:26 PM
tool supporting SPL vijaya2006 HP-UX 0 07-31-2006 05:34 AM
Issue with AIX 5.3 and nlist/nlist64/knlist lawrence AIX 0 03-03-2005 02:19 PM



All times are GMT -4. The time now is 08:47 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.