Created
April 14, 2023 17:40
-
-
Save firedynasty/2e3b64a6c14d7bcf8b9cdfff91541354 to your computer and use it in GitHub Desktop.
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
function get() { | |
if [[ $# -eq 0 ]]; then | |
echo "No file name provided." | |
echo "documents/forclipboard" | |
else | |
file_path="/Users/username/documents/forclipboard/${1}.txt" | |
if [ -f "$file_path" ]; then | |
cat "$file_path" | pbcopy | |
echo "File content copied to clipboard." | |
else | |
echo "File not found." | |
fi | |
fi | |
} | |
#this function is designed to copy to the clipboard contents of a text file if it exists. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment