How to store folder name created in variable to be used by FTP?

0

I'm trying to make a script that creates a folder with the name of the day and then in that folder put a file downloaded by ftp

The part of creating the folder is done which is the following:

cd..
cd..
cd Carpeta
mkdir %date:~-4,4%%date:~3,2%%date:~-10,2%

As the name of the folder will vary daily, I have to store it in a variable and then specify it with the FTP lcd command and download the file there. I searched the Internet, but I could not find something specific about it.

Is this possible to do?

    
asked by Erick Estevez 29.11.2018 в 17:04
source

1 answer

1

To set a variable in a bash script, simply define it and assign it the value. Ex:

carpeta=$(date +%Y-%m-%d)
mkdir "$carpeta"

then you must place your routine to download the files by FTP. Does this solve your doubt?

    
answered by 29.11.2018 в 17:23