How would I write this shell script as a Windows batch script?

Posted by Jeremy Banks on Stack Overflow See other posts from Stack Overflow or by Jeremy Banks
Published on 2010-03-04T14:26:29Z Indexed on 2010/03/19 18:01 UTC
Read the original article Hit count: 153

Filed under:

I haven't had a chance to test this script, I'm just using it as a suitable pseudocode. It's just supposed to copy all files in the current directory into a timestamped subdirectory.

ID="$(date +%Y%b%d%H%M%S)"
COMMITABLE="$(ls | egrep --invert-match ^(STATES|PARENT)\$)"
STATE_PATH="$(pwd)/STATES/$ID"
mkdir --parents "$STATE_PATH"
cp $COMMITABLE "$STATE_PATH"
ln -s "$STATE_PATH" PARENT

© Stack Overflow or respective owner

Related posts about batch