Created
February 16, 2022 21:45
-
-
Save megawertz/b2b6075f8343f081a2b2e831bc953a02 to your computer and use it in GitHub Desktop.
Command to remove Blackboard name additions from uploaded files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This works fine | |
for f in *.java; do i=$(echo $f | awk -F "_" '{print $5}'); mv "$f" $i; done | |
# Can also do this with awk's system command. Trying to work around spaces was quite the adventure here. | |
# https://unix.stackexchange.com/questions/148454/how-to-escape-spaces-etc-in-passed-variable-for-system-call-to-cp-in-awk | |
find . -name "*.java" -exec echo '{}' \; | awk -F "_" '{system("echo '\''" $0 "'\'' " $5)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment