Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:18:56+00:00 2026-06-15T03:18:56+00:00

Anyone has an idea what will be the problem? #!/bin/bash -x HOST=’192.163.3.3′ USER=’ftpuser’ PASSWD=’apple’

  • 0

Anyone has an idea what will be the problem?

#!/bin/bash -x

HOST='192.163.3.3'
USER='ftpuser'
PASSWD='apple'
Logfile=a.log

while :; do
ftp -n -p -v $HOST < example.script >> a.log
grep -qF "Connected" a.log &&
grep -qF "File successfully transferred" a.log && break
done

quote USER $USER
quote PASS $PASSWD

example.script contains

 put example.txt

after running it gives

 grep: a.log: No such file or directory
 grep: a.log: No such file or directory
                .
                .

example.script and the created a.log is on /home directory

the a.log contains

 Connected to 192.163.3.3.
 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
 220-You are user number 9 of 50 allowed.
 220-Local time is now 14:38. Server port: 21.
 220-This is a private system - No anonymous login
 220-IPv6 connections are also welcome on this server.
 220 You will be disconnected after 15 minutes of inactivity.
 Remote system type is UNIX.
 Using binary mode to transfer files.
 local: example.txt remote: example.txt
 530 You aren't logged in
 Passive mode refused.
 221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
 221 Logout.

why cant i logged in?

  HOST='192.163.3.3'
  USER='ftpuser'
  PASSWD='apple'
  FILE='example.txt'
  Logfile=a.log

  ftp -n -p -v $HOST << SCRIPT_END >> a.log
  quote USER $USER
  quote PASS $PASSWD

  put $FILE
  SCRIPT_END

with this it works but why? what will be the difference?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:18:58+00:00Added an answer on June 15, 2026 at 3:18 am

    I usually find creating a netrc file and using that to at least start my FTP session gets me around a lot of issues with scripting an ftp session. Most ftp programs give you the option of using an alternate netrc file, so you don’t need to setup one at $HOME/.netrc.

    I believe you just need a one liner like this:

    machine 192.163.3.3 login ftpuser password apple
    

    Unfortunately, I can’t test it because I don’t have ftp setup anywhere. Everything here is scp/ssh/sftp. Here’s an example .netrc file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

has anyone an idea why I have the following problem with passing locals to
It will keep counting down and updating the current time. Anyone has any idea
I wonder if anyone has an idea how you have to transform an image
has anyone an idea how to convert a UIImage to cocos2d-x CCSprite. My latest
Has anyone an idea how pipebytes.com works ? I need to implement similar system
Has anyone got any idea why the menu is rendering below the rotating images
Has anyone an idea how achieve such a functionality? I have two absolutely positioned
Do any one has any idea from where the below $ isUserLoggedInor $hideRegisterLink variable
anyone has a working example of a TTThumbsViewController used with files included in the
Anyone has a ready implementation of the Reverse Breadth First traversal algorithm in C#?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.