Using lower-case variable names to avoid conflicts with local environment variables or shell-builtins ($USER
and $PWD
are both builtins, so you shouldn't be setting them yourself):
lftp
-e "cd /inbox; put $file"
-u "$user,$pwd"
"$host"
The point, here, is invoking lftp
only once, and passing all the necessary commands to that single invocation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…