Counting Files in Remote location using sftp in shell script
0
votes
2
answers
212
views
Getting Error with the below command to check on the Remote directory a specific type of files. The requirement is to get the count of the specific files.
file_exists=$(sftp $FTP_UNAME@$FTP_HOST ls *$FILE_ID*.txt | wc -l)
Is this not properly written? Please help...
Below is the Usage Tip -
usage: sftp [-1246aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
[-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
[-o ssh_option] [-P port] [-R num_requests] [-S program]
[-s subsystem | sftp_server] host
sftp [user@]host[:file ...]
sftp [user@]host[:dir[/]]
sftp -b batchfile [user@]host
Asked by MALABIKA GARAI
(1 rep)
Feb 6, 2024, 03:23 PM
Last activity: Feb 6, 2024, 06:30 PM
Last activity: Feb 6, 2024, 06:30 PM