Skip to content

Instantly share code, notes, and snippets.

@brunosan
Created May 8, 2012 20:49
Show Gist options
  • Save brunosan/2639157 to your computer and use it in GitHub Desktop.
Save brunosan/2639157 to your computer and use it in GitHub Desktop.
Say you need to put some files on 100 USB sticks...
#!/bin/sh
for i in {1..999}
do
echo "Waiting for some love"
while [ ! -s /Volumes/USB\ DISK/ ]
do
sleep 0.5
printf "."
done
echo $i
echo "Making new friends!"
sleep 0.5
cp -vr ~/Desktop/tocopy/* /Volumes/USB\ DISK
diskutil rename /Volumes/USB\ DISK GAIN
diskutil unmount /Volumes/GAIN
printf "hu yeah!"
echo ""
done
@brunosan
Copy link
Author

brunosan commented May 8, 2012

Only work for OSX. Just copy, make it executable and run.
Then you only need to plug it, and wait for it to ask for the next one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment