bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature Request: scanf-like parsing


From: Léa Gris
Subject: Re: Feature Request: scanf-like parsing
Date: Fri, 22 Jan 2021 19:27:12 +0100
User-agent: Telnet/1.0 [tlh] (PDP11/DEC)

Le 22/01/2021 à 19:18, Léa Gris écrivait :
Now replace the the () with {}, replace the implicit temporary fifo by and implicit temporary file; then have the same feature but without spawning a sub-shell.


Instead of:

tempfile=$(mktemp) || exit 1
trap 'rm -f "$tempfile"' EXIT
compgen -u >"$tempfile"
mapfile -t users <"$tempfile"

You'd have:

mapfile -t users < <{ compgen -u;}

--
Léa Gris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]