I know its considered bad practice to check for an empty string with something
like:
if [ $STR = ] ; then
but what shells do actually break with this, and under what conditions?
I was proposing someone change a test like that to
if [ x$STR = ] ; then
but someone has argued against this,
On 02/10/2011 11:56 AM, Dr. David Kirkby wrote:
I know its considered bad practice to check for an empty string with
something like:
if [ $STR = ] ; then
but what shells do actually break with this, and under what conditions?
At least Solaris /bin/sh mishandles particular $STR:
$
Hello David,
* Dr. David Kirkby wrote on Thu, Feb 10, 2011 at 07:56:24PM CET:
I know its considered bad practice to check for an empty string with
something like:
if [ $STR = ] ; then
but what shells do actually break with this, and under what conditions?
It's not shells that break.
On Thursday 10 February 2011, Dr David wrote:
I know its considered bad practice to check for an empty string with
something like:
if [ $STR = ] ; then
but what shells do actually break with this, and under what conditions?
Solaris 10 /bin/sh breaks with [ $var != ] for some (very
On 10 February 2011 18:56, Dr. David Kirkby david.kir...@onetel.net wrote:
I know its considered bad practice to check for an empty string with
something like:
if [ $STR = ] ; then
but what shells do actually break with this, and under what conditions?
I was proposing someone change a
On 02/10/2011 12:40 PM, Ralf Wildenhues wrote:
Hello David,
* Dr. David Kirkby wrote on Thu, Feb 10, 2011 at 07:56:24PM CET:
I know its considered bad practice to check for an empty string with
something like:
if [ $STR = ] ; then
but what shells do actually break with this, and under
On Thu, 10 Feb 2011, Stefano Lattarini wrote:
but someone has argued against this, saying he knows of no shell where the
former is not acceptable. I realise this issue is probably more of a problem
with older shells,
Solaris 10 /bin/sh is not really old.
I do see the issues you mention