From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19479 invoked by alias); 18 Jan 2015 19:31:51 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19740 Received: (qmail 22054 invoked from network); 18 Jan 2015 19:31:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_FSL_HELO_BARE_IP_2 autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1421609499; bh=Q4HKyDmhCh1QGNEVRMyOFeEh3JYNQj/qO3N4yFr9Vyc=; h=From:To:In-Reply-To:References:Subject:Date; b=FS7GY1ZLIXXiekISD2TUOUN2WeyGaDP2m0E5prIR36Wa8IVDb7KsZU2BMLrzUmgWN FsN3iqJn6XA1wktLizVINVNHv5FNeAceELOPVeT+lrKU5ENczzoGinGupKxeN8D1F+ BohYyj3gVf9HGgjj8pZqwj3lZJSY0mdpQWu1+drk= From: ZyX To: Nikolai Weibull , Zsh Users In-Reply-To: References: Subject: Re: Equivalent of set -- *(DN) in sh MIME-Version: 1.0 Message-Id: <4640221421609498@web10g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 18 Jan 2015 22:31:38 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 18.01.2015, 21:36, "Nikolai Weibull" : > Hi! > > Is there any way to get the equivalent of Zsh’s > > set -- *(DN) > > in sh?  Most important here would be NULL_GLOB, as, by default, sh > simply leaves the * if there are no files to match. > > Thanks! If you are OK with bash then you may use `shopt -s nullglob; shopt -s dotglob` and use `set -- *`. Note that solution posted by Roman Neuhauser does handle names with spaces and tabs, but not newlines, if you set $IFS to a newline. As-is it has problems with all characters in IFS which are not just space, but also tab and newline.