#!/bin/bash ## Some good old plumbing hack. ## Google chrome closes the tempfiles from the Flash plugin, so we need a detour though /proc. # workaround for nonstandard ls output LS='ls -l --time-style=+%Y-%m-%d' [ -z "$MPLAYER" ] && MPLAYER=mplayer PROC=`lsof -n |grep Flash | awk '{print $2}'` FD=`$LS -l /proc/$PROC/fd | grep Flash | awk {'print $7'}` FILE=/proc/$PROC/fd/$FD ls -al $FILE $MPLAYER $FILE # Save [ -z "$1" ] || cp $FILE "$1"