What I'm really trying to do is strip a bunch of windows shortcuts of the prefix "Shortcut to ". I'm having trouble I think because of the whitespace, so I converted it to underscores, which really isn't desirable. I'm quite new to anything cl beyond basic navigation, but I'm hopefully learning as I piece together googled scraps of code.
Code:
for FILE in *lnk; do NEWFILE=`echo $FILE | sed 's/Shortcut to //g'`; echo "$FILE becomes $NEWFILE"; done
for FILE in *.lnk; do NEWFILE=`echo $FILE | sed 's/Shortcut to //g'`; mv $FILE $NEWFILE; done
The first displays as expected, but the second errors: mv: target `[X].lnk' is not a directory
To incorporate find for subdirectories, should it be "for i in find .lnk ./;"?