Jump to content

Unix Shell Script .. Help.!


Recommended Posts

Posted

nenu FTP use chesi oka remote server ki connect avthunnanu..

 

I want to check an existence of file on remote server.. search chesthe 

 

can you help me how to check existence of a remote file over FTP?

 

how can I achieve this over FTP please help?

 

 

 

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • chinni005

    15

  • sigsegv

    6

  • ramafdb

    5

  • Keratam

    5

Posted

 

nenu FTP use chesi oka remote server ki connect avthunnanu..

 

I want to check an existence of file on remote server.. search chesthe 

 

SSH use chesi check chymantunnaru but when i use it connection refuse on port 22 antundhi,..

 

how can I achieve this over FTP please help?

 

uncle port 21 FTP ki 22 SFTP ki

Posted

uncle port 21 FTP ki 22 SFTP ki

yeah got it...

 

can you help me how to check existence of a file over FTP?

Posted

yeah got it...

 

can you help me how to check existence of a file over FTP?

naaku script antha idea ledhu uncle but sftp server ayitey adi u can't connect using 21 remainging antha same 

list directory

Posted

y do u need a script for that

 

I'm doing a script for a whole other purpose and I need to include this check in that script ,

 

say .........

 

if [file remote file exists]; then

do something

else

do nothing 

fi

Posted

ls to list the names of the files in the current remote directory

 

Posted

naaku script antha idea ledhu uncle but sftp server ayitey adi u can't connect using 21 remainging antha same 

list directory

 

ls $filename  is giving me this error "usage: ls remote-directory local-file" , ftp server is not understanding 'ls' command

Posted

ls to list the names of the files in the current remote directory

 

 

ls $filename  is giving me this error "usage: ls remote-directory local-file" , ftp server is not understanding 'ls' command

 

bruh, please read above quote..

Posted

bruh, please read above quote..

 

bro it shud work if you connected successfully 

  • Upvote 1
Posted

try this to connect ftp

 

#!/bin/bash
hostname="<host>"
ftp -i -nv $hostname << EOF
user
<username> <password>
ls -R
EOF

Posted

weird thing enti ante I have 3 files in the remote location

 

323232.xml

 

chinni005 keretam 32323.pdf

 

chilligaari spiderreddy official.pdf

 

same ilage 3 files unnayi including spaces and all the file names are same format, 

 

when I do "ls 323232.xml" it is giving me correct results

 

but when I do "ls chinni005 keretam 32323.pdf" it is giving me the error "usage: ls remote-directory local-file" 

 

please Help..!!

Posted

try this to connect ftp

 

#!/bin/bash
hostname="<host>"
ftp -i -nv $hostname << EOF
user
<username> <password>
ls -R
EOF

 

 

trying...

Posted

if [-f $filename]

then

echo ''exist''

else

echo ''doesn't exist''

fi

 

 

Posted

try this to connect ftp

 

#!/bin/bash
hostname="<host>"
ftp -i -nv $hostname << EOF
user
<username> <password>
ls -R
EOF

 

why do u need a script to connect ftp..

 

ftp <servername>

<username>

<password>

 

enuf ryt??

×
×
  • Create New...