# Pulling Texts From Freewrite Alpha // 24-8-10 As described in the previous post, the Freewrite Alpha permits offline saving of drafts through the USB port, which allows its memory to be mounted as a virtual drive. One can then copy the drafts directly onto a connected computer. Unfortunately, the file names for the resulting text files are generated according to very simple rules: The first 31 characters of the draft with an appended `.txt` become the file name, i.e the name cannot easily be kept stable, which is especially annoying if one wants to put the drafts into a version control system (git in my case). To simplify this problem, I've written a short shell script that is explained directly in the following source code. --- #!/bin/sh info=v.04 # display help, if FWAMOUNT is unset or '-h' argument given: if test "$FWAMOUNT" = "" -o "$1" = "-h" then cat < $gdir/$rn done # cd back to the working directory (actually not needed right # now, as there is nothing further happening in the script, but # good practice anyway): cd $OLDPWD echo all done. else # if the user did not enter Y after the git status display: echo 'aborted!' exit fi else # if git returned a non-zero status: echo "error: 'git pull' failed -- is the current dir a git working dir?" echo ' [get help by launching this script with argument -h]' exit 3 fi else # if FWAMOUNT doesn't seem to point to what we expect: echo "error: cannot read directory FWAMOUNT='$FWAMOUNT'" echo ' [get help by launching this script with argument -h]' exit 2 fi