|What is the best way to get the equivalent power of Linux shell scripting (e.g., bash) on Windows (XP)? I can write Perl scripts, but what would be nice would be a "cookbook" of code fragments to accomplish various tasks. For instance, in Linux I can write a single command something like:|
for f in `find / -name "*.jpeg" -print`; do
mv $f $p/$b.jpg
to rename all *.jpeg on my system to *.jpg (as an example -- I haven't actually debugged it, and there may be simpler ways to do it). I would be looking for a cookbook of fragments to write the equivalent Perl script running in the DOS window. In pseudocode, it might be something like
get list of all *.jpeg files (recursively)
put into array
loop through array of file names one at a time
copy src name to dst name
use string functions to change extension of dst name
rename src dst
I don't want to install Cygwin or any other major system (I do have Perl already), and I would prefer not having to learn yet another shell/batch language (I hear there is a new one in Windows). I would be happy just to not have to reinvent the wheel when working in Perl and be able to do common tasks that are so simple with a good shell language. Any suggestions, preferably for an online resource? Thanks!
P.S. This would often be "batch", but a nice bonus would be interactive Perl programming, where I can be asked for input.