oggzee said:
EeZeEpEe said:
Do you know if move_dirs.bat works in Terminal for Mac OS X? I don't know how to get it working.
It doesn't of course
I thought so. lol. Okay I'll just work with the command lines then. Thanks.
Here is the .bat rewritten as a shell script for the linux/macosx:
CODE
#!/bin/sh
# move_dirs.sh by oggzee
#
# Usage:
# 1. place wbfs_file in same directory where this .sh file is located
# 2. run ./move_dirs.sh /path/to/wbfs
#
# or:
#
# 2. edit the below variable: WBFS_DIR
# 3. run: ./move_dirs.sh
WBFS_DIR=/mnt/usb/wbfs
##########################################
WBFS_FILE=./wbfs_file
if [ -n "$1" ]; then
ÂÂÂÂecho Using specified wbfs dir: $1
ÂÂÂÂWBFS_DIR="$1"
fi
if [ ! -e "$WBFS_DIR" ]; then
ÂÂÂÂecho Error: missing wbfs dir: $WBFS_DIR
ÂÂÂÂexit
fi
if [ ! -e "$WBFS_FILE" ]; then
ÂÂÂÂecho Error: missing $WBFS_FILE
ÂÂÂÂexit
fi
echo Games to be moved in $WBFS_DIR:
echo
for I in "$WBFS_DIR"/*.wbfs; do
ÂÂÂÂecho "$WBFS_FILE" "$I" id_title
ÂÂÂÂ"$WBFS_FILE" "$I" id_title
ÂÂÂÂif [ $? != 0 ]; then
ÂÂÂÂÂÂÂÂecho ERROR $WBFS_FILE "$I" id_title
ÂÂÂÂÂÂÂÂexit
ÂÂÂÂfi
done
echo
echo move these games?
read ASK
if [ "$ASK" != "y" ]; then
ÂÂÂÂecho bye
ÂÂÂÂexit
fi
echo
echo Moving: ...
echo
for I in "$WBFS_DIR"/*.wbfs; do
ÂÂÂÂFN=`basename $I .wbfs`
ÂÂÂÂIDT=`"$WBFS_FILE" "$I" id_title`
ÂÂÂÂecho Moving to: "$IDT"
ÂÂÂÂecho mkdir "$WBFS_DIR/$IDT"
ÂÂÂÂmkdir "$WBFS_DIR/$IDT"
ÂÂÂÂecho mv "$WBFS_DIR/$FN*.*" "$WBFS_DIR/$IDT"
ÂÂÂÂmv "$WBFS_DIR/$FN"* "$WBFS_DIR/$IDT"
ÂÂÂÂecho
done
echo
echo ===== DONE =====
echo