Re: Ash wildcard usability bug

2016-10-26 Thread Lauri Kasanen
On Wed, Oct 26, 2016, at 05:44, Kang-Che Sung wrote:
> I wonder why you can't implement an easy workaround using ls or
> something.
> 
> filename="`ls *zip | head -n 1`"
> nc 10.0.0.1 12345 < "$filename"
> do_something_else < "$filename"
> 
> Yeah. Just avoid the glob on the redirection and instead get the
> filename before that. Any difficulty?

Because typing that takes longer? You're missing the point of an
usability feature.

- Lauri

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: Ash wildcard usability bug

2016-10-26 Thread Bastian Bittorf
* Kang-Che Sung  [26.10.2016 10:00]:
> filename="`ls *zip | head -n 1`"
> nc 10.0.0.1 12345 < "$filename"
> do_something_else < "$filename"
> 
> Yeah. Just avoid the glob on the redirection and instead get the
> filename before that. Any difficulty?

better do (without pipes and cheating):

for file in *zip; do
  test -f "$file" && action...
done

bye, bastian
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


AW: Ash wildcard usability bug

2016-10-26 Thread dietmar.schindler
> Von: Lauri Kasanen [mailto:cur...@operamail.com]
> Gesendet: Dienstag, 25. Oktober 2016 19:25
>
> > > On Mon, Oct 24, 2016, at 20:09, Denys Vlasenko wrote:
> > > > Note that they allow to consistently never do globbing on the
> > > > redirect word.
> > > >
> > > > To me it looks like the best course of action.
> > >
> > > Surely we all agree that it's terrible usability to not expand it?
> >
> > It may be terrible, but it's conforming to POSIX. ;-)
> >
> > But in earnest, I think in most cases it is more convenient to use Tab
> > completion rather than *.
>
> Well, I did try to use tab completion: cat < *zip[TAB]
>
> Of course it doesn't work. In my case, I had many files sharing a
> prefix, but only one ending in *zip, so typing that was several
> times faster than letter- tab, oh more letters, tab, oh, more
> letters, tab, more

In this example, you could use the even shorter: cat *zip
But I see your point - there are indeed cases where pathname expansion on 
redirections is utile, and since it's also conforming to POSIX for an 
interactive shell, I have no objection to it.
--
Best regards,
Dietmar

manroland web systems GmbH -- Managing Director: Alexander Wassermann
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No.: 26816 -- 
VAT: DE281389840

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you are not the intended recipient, you are hereby notified that any use or 
dissemination of this communication is strictly prohibited. If you have 
received this eMail in error, then please delete this eMail.

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox