On Wed, 2 May 2012 11:40:52 +1100
Jerome Alet <jerome.a...@univ-nc.nc> wrote:

[...]
> Attached to this message you'll find the shell script I'm now using.
[...]

The correct way to deal with temporary files in shell scripts is
using mktemp to generate a temporary file with unique name:

BSCRIPT=`mktemp`
trap "rm -f '$BSCRIPT'" TERM INT EXIT
# populate the $BSCRIPT
bconsole -n <"$BCSCRIPT" >/dev/null

or a bit more fancy and robust:

BSCRIPT=`mktemp`
exec 3>$BSCRIPT 4<$BSCRIPT
rm -f $BSCRIPT
cat >&3 <<EOF
# the script goes here
EOF
bconsole -n <&4 >/dev/null

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to