0

I'm trying to make a script become headless (the same way if I'd of run something with nohup) after the user running the script has provided the read inputs.

Here is the script I'm using:

read -p "Please Input IP for FTP Server: " ip
read -p "Please Input FTP User: " ftpuser
read -p "Please Input FTP Password: " ftppasswd_u
read -p "Please Input The Patch Number You Wish To Download eg. 20180122: " FILE
read -p "Please Input Which Version Of TMFF You Are Downloading A Patch For eg. V191: " version

ftppasswd=${ftppasswd_u//@/%40}
#ftppasswd=$(sed 's/@/%40/' $ftppasswd_u)

echo "Downloading Patch " $FILE "from " $ip

wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/weblogic
wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/documentps
wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/Readme.docx

To confirm, as soon as the user has provided all the read inputs I want the wget's to be headless (so the user can close their shell). Is this possible? Thanks

1 Answer 1

0

Yes. The easiest way is:

nohup wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/weblogic &
nohup wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/documentps &
nohup wget -rnv ftp://$ftpuser:$ftppasswd@$ip/Patches/by_date/$FILE/Readme.docx &

This will let the wget run concurrently, which is probably OK.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .