Created
July 16, 2016 02:25
-
-
Save mnemnion/ed8222f767638a57e9ec6a8185848383 to your computer and use it in GitHub Desktop.
Simple Bash functions: file -> .file, and .file -> 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
#lazyfuncs for dotting and undotting stuff | |
function dt { | |
for file in "$@"; do | |
if [[ ${file:0:1} != "." ]] | |
then mv $file ".$file" | |
else echo "$file is already dotted" | |
fi | |
done | |
} | |
function undt { | |
for file in "$@"; do | |
if [[ $file != ".." && $file != "." ]] | |
then | |
if [[ ${file:0:1} == "." ]] | |
then mv $file ${file:1} | |
else echo "$file is not a dotted file" | |
fi | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment