Last active
May 4, 2016 01:09
-
-
Save tylerneylon/2ff951d82a33223f4de836d3a4c4108d to your computer and use it in GitHub Desktop.
Bash function to simplify usage of mac os x s
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
ssfile () | |
{ | |
f="$(ls -1tr $HOME/Desktop/Screen*.png | tail -1)"; | |
g=$(echo $f | tr ' ' _); | |
mv "$f" "$g"; | |
echo $g | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
ssfile
from bash in any directory. Examples:The script replaces all spaces in the screenshot's filename for easier use from bash. This change is idempotent, meaning that repeated use of
ssfile
continues to refer to the most recent screenshot until you move or rename the file to something that no longer matchesScreen*.png
in your desktop.