From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3835 invoked by alias); 28 Mar 2017 16:42:36 -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: 22631 Received: (qmail 15046 invoked from network); 28 Mar 2017 16:42:36 -0000 X-Qmail-Scanner-Diagnostics: from mail-yw0-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.161.196):SA:0(0.7/5.0):. Processed in 1.013017 secs); 28 Mar 2017 16:42:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM,SPF_PASS,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: phy1729@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.161.196 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=RtYzZQ5uuoAfkCFnH56jFhqz2+EcPM5H6hJR/qPkHJw=; b=ge9Jx78jb9AcmChIxudaCLRCnCuRjBLkQNINtnZFAkFKf2LzkpjtT+v14Mt61yYn9J 0Vys5k1nZEbxLk1yjb6OnmJdSAscyy7lCEn58S26NOmuYNP6R1fsZvqZ12xRRcpWfEax Wom+4kFn9qyuzjHTSP4Re8oVSOC7tSs9WMRAiwvASoC4CYPufMbeImt2h4yUMe847bFO p1ne1R8s6p4bklbmOcLiBwvKdBD3eUZE/uTaqM3Xpzfn+hxMuPbQrQVOccP384eP6lCJ s24Ib15QOyomIYeofSOPJQhQH5zNO7ZgCCa+DzcYaldKGQQ9DNSTNqmDGJM5ejMnrset v1pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=RtYzZQ5uuoAfkCFnH56jFhqz2+EcPM5H6hJR/qPkHJw=; b=i3UyNxgCXlVtngj2XSTkVjOZULyv45NKYI0Ku6wGHmqmU8OusF/SdW5Ek9foGI8j1Q oPfgW2oNN30DDQWHPW57U2XBMCAlvpGY56BHxRKknV5oNRVWLMRKhXS27lISRhQH7s+e BGat7vs3ooId4DyOwP9wkYwQnPNcNpkUWs8cIuuNbtXhdfejwmZTQJQ3mAHbclIq/zmc lWa2BjGFb23ANns3EPNlPrLpFWYn1eKv9rF5Av2JtBH3EpzM2DS7ouRm8RHoAkHGQrsL F8Pgn/kVCo2EZQjIR9q8MTe5FfK3ziEjG88NnHP15pJ9I7o5MCCElyOqFON1Avx5Rpno 39WQ== X-Gm-Message-State: AFeK/H1q0lrhbPF5LZRic9IjaeMXcL/ypp84JlPvhpEAQk74rA5uRTgwCyVbcoTmx8f6cw== X-Received: by 10.37.161.74 with SMTP id z68mr21183662ybh.134.1490719350440; Tue, 28 Mar 2017 09:42:30 -0700 (PDT) Date: Tue, 28 Mar 2017 11:42:27 -0500 From: Matthew Martin To: Jesper =?iso-8859-1?Q?Nyg=E5rds?= Cc: Zsh Users Subject: Re: spaces in filenames should be a crime. Message-ID: <20170328164227.GA48117@CptOrmolo.darkstar> Mail-Followup-To: Jesper =?iso-8859-1?Q?Nyg=E5rds?= , Zsh Users References: <0c1b9d89-edd0-a027-e2f1-d01c2d68fa4e@eastlink.ca> <20170326211805.GA8170@fujitsu.shahaf.local2> <7d210765-c730-da1d-bb22-19f26ce02c6e@inlv.org> <85ef8db4-4fda-8276-3058-ab319ccb68bc@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) On Mon, Mar 27, 2017 at 08:53:17PM +0200, Jesper Nygårds wrote: > If you'd suggest a solution using 'ls' on the bash-help mailing list, you'd > get lynched. Although I have always found the tone on that list less than > welcoming, I've taken that recommendation to heart. What is the opinion > here? Should 'ls' as a basis for file name generation be avoided at all > cost? It's pretty clear that it is never a necessary tool for the job. I wouldn't say never. There are some inventive uses in the tree. Completion/Unix/Command/_cvs: if _cvs_loadstat; then id="$(LC_ALL=C builtin zstat -g +mtime -F '%Y/%m/%d-%T' "$cvspassfile")" else id="$(LC_ALL=C ls -l "$cvspassfile")" fi if [[ "$id" != "$_cvs_pass_id" ]]; then slash=/ _cvs_roots=($_cvs_roots ${${${${(f)"$(<$cvspassfile)"}#/1 }%% *}/:2401${slash}/:/}) _cvs_pass_id="$id" fi Test/C02cond.ztst: else unmodified_ls="$(ls -lu $unmodified)" print -u $ZTST_fd 'This test takes up to 60 seconds...' fi sleep 2 [...] { (( $+unmodified_ls )) && SECONDS=0 && ! until (( SECONDS >= 58 )); do ZTST_hashmark; sleep 2; cat $unmodified [[ $unmodified_ls != "$(ls -lu $unmodified)" ]] && break done }; then ZTST_skip="[[ -N file ]] not supported with noatime file system" While not technically correct, I don't know if there's a better way Completion/Zsh/Type/_file_descriptors: if link=$(ls -l $proc/$i); then list+=( "${(r.$#fds[-1].)i} $sep ${(D)link#* -> }" ) _hg and _remote_files could probably use printf '%s\0' with some glob, but there are systems that don't have printf (notably android which is why _adb uses ls).