Last active
May 18, 2018 01:45
-
-
Save melmatsuoka/8a9b866170e5f7f8b18e1faf519a7acf to your computer and use it in GitHub Desktop.
Extract original filename of renamed .R3D file
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 | |
# | |
# Extract the original filename of renamed .R3D file. This is useful for reconstructing | |
# R3D files restored from a data-recovery operation from an HFS+ drive. | |
# | |
# note: the “-m 1” argument tells grep to stop after the first returned match. | |
# The pipe to "cut” is a dumb way to trim the leading “V” character on the returned filename | |
strings "FILE.R3D" | grep -m 1 -E "^.*[A-Z][0-9]{3}_[A-Z][0-9]{3}_[0-9]{4}[A-Z0-9]{2}_[0-9]{3}.R3D" | cut -c2- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment