Created
May 22, 2020 14:59
-
-
Save brandongalbraith/9ac18674c237cd9440b30150c3b0b283 to your computer and use it in GitHub Desktop.
Create a .url file on MacOS
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
# Source: https://superuser.com/questions/689441/how-do-i-create-a-url-file-on-os-x | |
#!/bin/bash | |
if [[ $# -le 1 || $# -ge 3 ]] ; then | |
echo Usage: $0 '<namefile> <url>' | |
echo | |
echo Creates '<namefile>.url'. | |
echo Openning '<namefile>.url' in Finder, under OSX, will open '<url>' in the default browser. | |
exit 1 | |
fi | |
file="$1.url" | |
url=$2 | |
echo '[InternetShortcut]' > "$file" | |
echo -n 'URL=' >> "$file" | |
echo $url >> "$file" | |
#echo 'IconIndex=0' >> "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment