All of lore.kernel.org
 help / color / mirror / Atom feed
From: DENX Support System <support@denx.de>
To: u-boot@lists.denx.de
Subject: [DNX#2006040142000857] [U-Boot-Users] test variable existence in hush
Date: Sat, 1 Apr 2006 00:50:02 +0200	[thread overview]
Message-ID: <1143845402.996182.798114513@castor.denx.de> (raw)

Hello list,

inside the automatic U-Boot patch tracking system a new ticket
[DNX#2006040142000857] was created:

<snip>
> On Mon, 22 Aug 2005 14:21:58 +0200 Wolfgang Denk wrote:
> 
> >I cannot confirm this. The only part of hush which is  involved  here
> >is the && processing which works fine for me..
> >
> >"test" is NOT a hush builtin.
> 
> I hit the send button too early...
> 
> Yes, "test" is not a hush builtin, but it is only available if the hush
> parser is enabled.
> 
> >Sure:
> >
> >TRAB # foo=
> >TRAB # test -n "$foo" && echo yes
> >TRAB # test -n "$foo" || echo no
> >no
> >TRAB # test "$foo" && echo yes
> >TRAB # test "$foo" || echo no
> >no
> >TRAB # foo=dummy
> >TRAB # test -n "$foo" && echo yes
> >yes
> >TRAB # test -n "$foo" || echo no
> >TRAB # test "$foo" && echo yes
> >TRAB # test "$foo" || echo no
> >no
> >
> >THe only problem I see is with "test -z":
> >
> >	TRAB # foo=
> >	TRAB # test -z "$foo" && echo yes
> >	TRAB # test -z "$foo" || echo no
> >	no
> >but
> >	TRAB # test -z "" && echo yes
> >	yes
> >	TRAB # test -z "" || echo no
> >	TRAB # 
> 
> No, I think this is misleading. A quick debugging session showed that
> the problem is not the "test" command itself. With 'test -z ""' and
> 'test -n ""', the command will correctly see three arguments. However,
> with 'test -n "$foo"' and 'test -z "$foo"' (and empty $foo), the command
> will only get two arguments which always results in a return value of 1.
> That's why 'test -n' seems to work.
> 
> Regards,
>   Andreas Engel
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
> QA
> Security * Process Improvement & Measurement *
> http://www.sqe.com/bsce5sf
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
</snip>

Your U-Boot support team

                 reply	other threads:[~2006-03-31 22:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1143845402.996182.798114513@castor.denx.de \
    --to=support@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.