[afnog] mv not mv-ing :-(

Patrick J Okui pokui at psg.com
Wed Sep 19 11:30:47 UTC 2007


Hi Frank,

As a hint to why this isn't working, replacing your second echo $?  
with an exit or an ls -l will show you that you created the file...

On 19 Sep, 2007, at 1:58 PM, Frank Habicht wrote:

> #FLOWARCHIVEDIR=${FLOWDIR}/archive

.... which means this variable is unset

> #rm or mv
> if [ "${FLOWARCHIVEDIR}" ]; then
>  /bin/mv -f ${MYFLOWFILE} ${FLOWARCHIVEDIR}/ 2>/dev/null
> else
>  /bin/rm -f ${MYFLOWFILE} 2>/dev/null
> fi


hmm... not sure what test you want to run here. do you want to test  
if the variable has been set? if [ -n ${...} ] or do you want to test  
if the directory exists? if [ -d ${ ... } ] or both? if [ -n ${..} -a  
-d ${ ...} ] ...

Also, removing the 2>/dev/null is always good when debugging since  
it'll give you errors, you should try it.

I'm guessing that on the first machine

1. you have a FLOWARCHIVEDIR set
2. the archive directory exists.


--
patrick






More information about the afnog mailing list