can someone please suggest a script to rename a file that was generated today and filename that being generated daily starts with date, its a xml file.
In case you are not aware, -mtime -1 is not constrained to "a file that was generated today." It will match anything that's less than 24 hours old, which usually includes a portion of yesterday.
If the file must have been created on the current calendar day, perhaps you'd be better off using the date command to generate a filename pattern argument for the -name primary.
I just tried this format, but not working, please suggest here
$ ls -lrt
total 168
-rw-r----- 1 z504783 ctlab_admin 166593 May 29 10:17 20130529_4995733057260357019.xml
$
$ file =$(`find . -name `date +%Y%m%d`_*.xml`) ; mv $file renamedfeed_`date +%Y%m%d`.xml
find: missing argument to `-name'
-bash: _*.xml: command not found
=20130529: ERROR: cannot open `=20130529' (No such file or directory)
mv: missing destination file operand after `renamedfeed_20130529.xml'
Try `mv --help' for more information.
$