Sharing shell scripts between machines
If you use multiple Macs, you may find yourself writing and editing scripts that could be useful on all of your machines. This is another potential use of iCloud Drive. Here’s what I do:
I created a “bin” folder at the top level of my iCloud Drive
I set up a symlink from my home directory to iCloud Drive on each of my machines using the same iCloud account:
ln -s /Users/admin/Library/Mobile\ Documents/com~apple~CloudDocs/bin ~/bin
I set up my shell config file to add ~/bin to the PATH variable.
export PATH=~/bin:/usr/bin:/bin:$PATH
Start writing and editing scripts that are quickly available on all machines!
Keep reading with a 7-day free trial
Subscribe to Tech Reflect to keep reading this post and get 7 days of free access to the full post archives.