Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know similar questions have been asked before but I cannot seem to get it to work.
I have a file file.something.nhMMYY that i need to ftp
(MMYY being Month and Year)
I want to add something into the script to auto-magically insert the MMYY
I can get the date format by using
Here is the part of the script that does work
Any help would be appreciated. Thanks!
actually i dont think the answer i gave before is what you are looking for?
so you want a file created with the date appended? or you need to automatically include a file named with a certain date?
The short var names and echo are just for illustrative purposes (and because I'm lazy ).
I recommend you use more meaningful names in real code. You can assign the generated name immediately to the ultimate var (FILE), no need to use an intermediate (nf).
the put command was a typo. I am actually trying to download the file on a monthly basis.
I am hopeful though I have not yet had a chance to test yet.
I tested the script Im 99% there.
problem is that the file name on the remote system is 'filenameMMYY'
(note the single quotes)
the script displays the filenameMMYY but does not have the single quotes.
any ideas on adding those dam quotes to the script?
No system should be creating a filename that actually has quotes in it. Are you really sure that's not just a displaying issue?
If(!) it really has quotes, that needs fixing; its going to cause all sorts of issues, as you've discovered.
If you have to live with quotes (yuck!), try backslash to escape them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.