Created
September 9, 2019 00:33
-
-
Save IamPhytan/7fc5c4d061038b36dca5ab77730ff17d to your computer and use it in GitHub Desktop.
Append text to filename
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
| FOLDERPATH=RandomFolder | |
| APPENDTEXT=_TextToAppend | |
| for name in $FOLDERPATH/*; | |
| do SUBSTRING=${name%.*}; | |
| ext=${name##*.}; | |
| mv $name $FOLDERPATH/${SUBSTRING##*/}$APPENDTEXT.$ext | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment