i would like to add the path to inserted flash drive named backup1 to a variable so i can copy /Documents/dir to this flash drive path in one script without user interaction
Mac – can i find usb path and save to variable for quick backups
backupbashmacpath
Related Question
- MacOS – In OSX Yosemite, why can I set many environment variables for GUI apps, but cannot set the specific variable PATH
- iOS – How to Copy and Paste iDevice Backups to an External Drive?
- Fix Terminal PATH Issue – How to Fix Terminal Hang After Editing PATH in .bash_profile
- MacOS – echo ‘export PATH=“/usr/local/thesql/bin:$PATH”’ >> ~/.bash_profile by using this command getting permission denied
- Add Shell Script to PATH – How to Add Shell Script to $PATH and Execute Properly
- How to quote a path variable “$1” that contains spaces
Best Answer
Try
B=/Volumes/backup1
and thencp -p /Documents/dir/* $B
.