#!/bin/sh # by klaatu at member.fsf.org ############################################################################## ## i hereby license this under the Klaatu Public License v3 ## # which is identical in all ways to the GPLv3 # ## except it doesn't require that I go and find the license and paste it ## #### into a ridiculously simple bash script such as this :^) ##### ############################################################################# # #### README ##### # # Hello, *nix user! this is a frightfully simple but infinitely helpful SMPTE timecode converter. # It is a shell script that you must run from a unix terminal. # Don't know how to run a shell script? It's easy! # # First, do this: # bash$ chmod +x smpte.sh # # That just made the shell script executable. From now on, you can use smpte.sh by typing in: # # bash$ ./smpte.sh # # ...but you must do that ONLY from the directory the shell script is in. ### # To make it even more flexible, you should create a "bin" folder in your home directory, add that "bin" to your path, and then you can run the shell script from anywhere. # # To do this, make a new directory in your home directory and call it bin. # bash$ cd ~ # bash$ mkdir bin # # Then copy the smpte.sh file into bin. # # Finally, add the bin to your path (replace "username" with your username): # bash$ PATH=$PATH:/home/username/bin # bash$ export PATH # # You may need to close and re-open your terminal or logout or some series of weirdness, # depending on what hacker threw together your distro, and if you're on OS X then it wont work anyway # but sooner or later you'll have access to smpte.sh from anywhere on your system. # # Enjoy! # echo "at what fps was the footage shot?:" read fps echo "what is the reading of smpte hours:" read hr hrmin=$(echo "scale=4; $hr*60.0" | bc) hrsec=$(echo "scale=4; $hrmin*60.0" | bc) hrfps=$(echo "scale=4; $hrsec*$fps" | bc) echo "what is the reading of smpte minutes:" read min minsec=$(echo "scale=4; $min*60.0" | bc) minfps=$(echo "scale=4; $minsec*$fps" | bc) echo "what is the reading of smpte seconds:" read sec secfps=$(echo "scale=4; $sec*$fps" | bc) echo "what is the reading of smpte frames:" read fr toto=$(echo "scale=2; $hrfps+$minfps+$secfps+$fr" | bc) echo "total frames are" $toto