Created
August 31, 2024 07:55
-
-
Save justsh/d9f987df794d29a96e58b483bae8f54b to your computer and use it in GitHub Desktop.
Changes the fileInfo license line in Maya ASCII files from "education" to "student"
This file contains hidden or 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
| #!/bin/bash | |
| main() { | |
| usage="${FG_CYAN}usage: removeStudent filename.ma${NORMAL}" | |
| if [ -z "${1}" ]; then | |
| echo -e "${FG_RED}Filename not given${NORMAL}" | |
| echo -e ${usage} | |
| elif [ ! -e "${1}" ]; then | |
| echo -e "${FG_RED}Filename ${1} does not exist${NORMAL}" | |
| echo -e ${usage} | |
| fi | |
| file="${1}" | |
| fixed="${1}.education" | |
| backup="${1}.student" | |
| sed 's,\(fileInfo "license"\) "student",\1 "education",' ${file} > ${fixed} | |
| mv ${file} ${backup} | |
| mv ${fixed} ${file} | |
| } | |
| main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment