Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.4.1
On 1/26/20 8:18 PM, Jack Bates wrote:
> Is there a way to access the $HISTCMD variable from a command substitution?
> e.g.
>
>> echo "$(echo "$HISTCMD")"
In bash versions through 5.0, no: $HISTCMD is a dynamic variable that
depends on the state of the history, and history is disabled in a command
substitution.
The devel branch has relaxed this restriction slightly, and will expand
$HISTCMD to the history number that was current when the command
substitution started.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/