linux - Bash - Need to use exit but then call another function? -


i'm writing little script use webcam on laptop , email across photo me. ffmpeg usage has have exit code work exit mail function not called. doing wrong?

#!/bin/bash  mail_addr=user@example.com ts=`date +%s` list=$(ls | tail -n 1)  function mcheese(){ mkdir /tmp/cheese cd /tmp/cheese echo -e "cheese " | mutt -s "$ts cheese" $mail_addr -a $list }  function cheese(){ ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /tmp/cheese/vid-$ts.%01d.jpg  exit 0 }  cheese mcheese 

you setup list in 1 directory, change directory , use it. unlikely work.

use bash -x work out script failing.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -