cp master date
March 15, 2012 4:06 AM Subscribe
I need help copying a master file to a file with a new name. Complication new name should be the date of the first of the month
posted by kathrynm to Computers & Internet (4 answers total) 1 user marked this as a favorite
I have an idea for a program for myself, but I was pulling out my hair trying to do this within python. So, on advice from a friend, I'm pulling that part out and making a cron job to do this on the first of the month using bash.
I can easily do this by hand. I don't want to. This is a tool to learn. I read the cp man page and I don't see an easy way to do it (though I'm also working through the mental fog of fibromyalgia here too).
I see there's a date command as well. Obviously this isn't going to be a bash one liner for me (though I'm sure 10 people will chime in how to do it).
Can I use `date` and write it to a variable and then use that variable to copy to a new file?
Please limit answers to bash and/or python. I know many of you like perl, but for me, perls are things you put on necklaces (as in I've never written a line of it).
I'm sorry if this seems disorganized and dumb, I'm quite ill at the moment, but I need something to get my mental muscles moving too. I wouldn't wish fibro on my worst enemy.