From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23731 invoked from network); 20 Oct 2008 00:29:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Oct 2008 00:29:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 54135 invoked from network); 20 Oct 2008 00:29:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Oct 2008 00:29:06 -0000 Received: (qmail 1516 invoked by alias); 20 Oct 2008 00:28:53 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25919 Received: (qmail 1495 invoked from network); 20 Oct 2008 00:28:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 20 Oct 2008 00:28:50 -0000 Received: from mx.spodhuis.org (redoubt.spodhuis.org [193.202.115.177]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 0154680524C0 for ; Mon, 20 Oct 2008 02:28:44 +0200 (CEST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=flCM3MxrCUUBFZaIDv9ClHVOtxtmmiGyLoOy9wwffzoJdhYpL67cDpgHkqr8NbIQ7LfYLRYgp5WsNYFEvR6y4mFnQNmku6TQMXtM+GYZTcB3h5+TO+yS38sVVv4Q6Ds9DWAHQW+0TbyORlffGdYpK84i8yb0HV/FXLwdNLKk/t0=; Received: by smtp.spodhuis.org with local id 1KridX-00013e-Bl; Mon, 20 Oct 2008 00:28:43 +0000 Date: Sun, 19 Oct 2008 17:28:43 -0700 From: Phil Pennock To: Dan Nelson Cc: zsh-workers@sunsite.dk Subject: Re: Notes on zsh, zsh/files and recovery Message-ID: <20081020002843.GA13631@redoubt.spodhuis.org> Mail-Followup-To: Dan Nelson , zsh-workers@sunsite.dk References: <20081018204515.GA1642@redoubt.spodhuis.org> <20081019063924.GO99270@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081019063924.GO99270@dan.emsphone.com> X-Virus-Scanned: ClamAV 0.92.1/8445/Sun Oct 19 16:45:49 2008 on bifrost X-Virus-Status: Clean On 2008-10-19 at 01:39 -0500, Dan Nelson wrote: > You mention FreeBSD later, so if something similar happens again, you > should be able to use the statically-linked binaries in /rescue to > recover from most shared-library problems, especially if you've got > another system you can NFS-mount to copy files from. For some reason, I thought a busted ld-elf.so.1 would break exec() of any ELF binary, even static ones, as it was always in the path. However, I neglected to even test it. I'll blame it on the same tiredness which made me completely forget about the existence of /rescue. I believe that the depth of feeling behind the "doh" as I read your mail will make it less likely for me to forget in future. Thanks. :) > In emergencies, I have used this as an ls replacement :) > > ls() { echo ${@:-*} } Yeah, "echo *" was the first thing I did, but I needed to see the size and timestamps to figure out which files were affected. function zls { local -A st; local f a='*'; [[ $# -eq 0 ]] && set -- *; for f ; do zstat -nsLH st $f; print -r -- "$st[mode] $st[nlink] ${(r:8:)st[uid]} ${(r:8:)st[gid]} ${(l:9:)st[size]} $st[name]" ; done } I wrote that on the spot, aside from using stat instead of zstat, which bit me when I tested it just now because I normally use: zmodload -F zsh/stat b:zstat in my user account but I didn't bother with such niceties at the time, as I no longer needed to worry about masking an external stat so just loaded the whole module. Obviously the fact that it only automatically lists all files when not given a parameter, otherwise acting like "ls -d" is a slight downside, but I got around that with zls dirname/* which was fine for me. A better zls would take -d as an option instead. -Phil