bash, AWK, sips. A couple of bash commands I use daily:
cdf - change directory to the folder open in (Mac) Finder
cdf () {
currFolderPath=$( /usr/bin/osascript <<EOT
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
end tell
EOT )
echo "cd to \"$currFolderPath\""
cd "$currFolderPath"
}
#dlm - "dlm filename" downloads filename.mp4 from URL in clipboard until its finished, resuming if interrupted
fname=$(pbpaste)
echo "Download $fname as $1.mp4 : "
until curl -C - -kLo $1.mp4 "$fname"
do
sleep 5
done