[Top][All Lists]

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

Re: curiosity: 'typeset -xr' vs. 'export -r'

From: Chet Ramey
Subject: Re: curiosity: 'typeset -xr' vs. 'export -r'
Date: Mon, 12 Dec 2022 11:40:03 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.1

On 12/11/22 9:37 PM, L A Walsh wrote:
  This is mostly a 'nit', but I noticed I had
    "typeset -xr"
  in one of my scripts to mean export+read-only and
  was wondering why
    "export -r"
  was disallowed (err message):

bash: export: -r: invalid option
export: usage: export [-fn] [name[=value] ...] or export -p

This seems to be an unnecessary "make-wrong", no?

No. There's no compelling reason to provide it. You can already do this,
as you discovered, using a builtin whose purpose is to assign attributes
to variables.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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