Get a list of filenames and move the files Bash and Power Shell

Both these scripts do the same thing, they strip a log file down to the filename and then move each file up a directory.



cat 15\ August\ 2011\ Less.log | cut -c 113-152 > fileNames
for i in `cat fileNames`; do mv -v "$i" ../$i; done


gc '.\15 August 2011 Less.log' |% {$_.Substring(56,20)} > fileNames
gc .\filenames | ForEach-Object {mv -v $_ ../$_}

Just my little note, from when I was playing with power shell. More than likely more to come >.>