Auto FTP login, without .netrc, reconnect stdin
Dear Linux Qs,
My question is a variation on the automatic ftp login question. I know I can use .netrc to store ftp credentials and macros. But the problem is that the ftp credentials can change regularly. I'm trying to write a simple script (or even better a one liner) that will automatically log into ftp for me but will give me back control after the login rather than just closing the ftp connection. I can login using an echo pipe: Code:
echo user usr pass | ftp -vn host.com Code:
ftp -vn host.com << EOF Code:
220 FTP server ready. If found a post http://www.linuxforums.org/forum/lin...n-problem.html In that post, he closes the stdin using Code:
exec 0<&- Code:
term="/dev/$(ps -p$$ --no-heading | awk '{print $2}')" Code:
exec < /dev/tty But I don't know implment this into a script. Also, out of ineterest, why when I pipe input, I don't see the input prompt? i.e. the "ftp>" Cheers, Richard |
All times are GMT -5. The time now is 11:49 AM. |