Deutsch English Français Italiano |
<ll9dlk-son.ln1@ID-313840.user.individual.net> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Geoff Clare <geoff@clare.See-My-Signature.invalid> Newsgroups: comp.unix.shell Subject: Re: [ksh93] defunct 'fc' command? Date: Tue, 2 Jul 2024 13:50:29 +0100 Lines: 41 Message-ID: <ll9dlk-son.ln1@ID-313840.user.individual.net> References: <v5trcn$10nuj$1@dont-email.me> <trlalk-d5q.ln1@ID-313840.user.individual.net> <v5ujfb$152jc$1@dont-email.me> Reply-To: netnews@gclare.org.uk Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net uFsa7OlPP+ZQxEQe02vPqgJl7qKqGDr18RSnH23wfe0XBgTIqp X-Orig-Path: ID-313840.user.individual.net!not-for-mail Cancel-Lock: sha1:OywO7FoesUTPX7fu2LhCEBSv2VI= sha256:yvsLsfHxtu2uIVHWpMhjAJ83u27y2MK/sypStbEQW88= User-Agent: Pan/0.154 (Izium; 517acf4) Bytes: 2137 Janis Papanagnou wrote: > On 01.07.2024 15:00, Geoff Clare wrote: >> >> If you just want the commands executed, you can specify an editor >> that does nothing: >> >> fc -e true 1013 1015 >> fc -e : 1013 1015 > > This is a nice code pattern. > >> >> Or, if you only want to execute one command, you can use -s (without >> specifying a substitution). > > I had tried this before and got an inconsistent error message (-e > instead of -s) when [inappropriately] trying for a range > > $ fc -s 1071 1073 > ksh: fc: -e - requires single argument > > so I haven't followed that path further. Yes, you can't give a range with -s (which is why I wrote "if you only want to execute one command" above). Looks like ksh implements -s by pretending that "-e -" was specified, but the output from "--help" implies the relationship is the other way round: OPTIONS -e editor editor specifies the editor to use to edit the history command. A value of - for editor is equivalent to specifying the -s option. It would make more sense for the code to do it that way too, since -s is in POSIX but "-e -" isn't. -- Geoff Clare <netnews@gclare.org.uk>