i am still new in this shell script. I have a task that given to me which i have difficulty to execute it. The task is i have a lot of directory which is based on ddmmyy.
03Mar2014 08Aug2013 11Jan2015 16Jan2014 22Feb2014 26Mar2014 03Nov2013 08Jan2014 11Jul2013 16Jul2013 22Jul2013 26Oct2014 03Oct2013 08Jan2015 11Nov2014 16May2014 22Mar2014 26Sep2013 The task is to make the directory to mmyy.
So far, my code is
foreach file(`find . -type d | awk -F/ 'NF == 3'`) echo $file set newmove = `echo $file | cut -c 1-2,5-` echo $newmove mv $file $newmove output: for find . -type d | awk -F/ 'NF == 3': ./24Jan2015/W51A `echo $file | cut -c 1-2,5-` ./Jan2015/W51A mv $file $newmove mv: cannot rename ./24Jan2015/W51A to ./Jan2015/W51A: No such file or directory but the script didnt work. Do you guys have any idea how to do this?
shand especiallybashare much better alternatives thancsh. This is a bit over-the-top, but its technical points are accurate: perl.com/doc/FMTEYEWTK/versus/csh.whynot