>>
-i$DEVICE >/dev/null 2> &1
>>

The shell will see $DEVICE as a variable to expand(macro),

the shell will interpret >/dev/null to mean you want the output to go to the abyse. Often used when all the script wants is the return status of the command, the 2> &1 is where the error was. The shell would normally expect it to read 2>&1 interpreting it to mean that you also want the standard error to be redirected to the standard output, and they can both go to the abyse.

Especially if the comand is being run in an non-interactive shell, which it probably is.

The error is just the "space" character. Which will be seen as a field seperator.

try in a term window ...

]$ ls /dev/null
]$ ls /dev/null 2>&1
]$ ls /dev/null 2>
]$ ls /dev/null 2> &1

notice the messages.

Not sure how it is being used in the script concerned, but it will cause it to fall over at that point.

Just needs a minor edit


jm

Code:
 -|-  If the system is the answer, then the question
               must have been really stupid         -|-