Chinaunix

标题: 如何取消readonly?? [打印本页]

作者: SickWorm    时间: 2003-06-20 17:04
标题: 如何取消readonly??
我设置了一个变量为readonly,在shell下作试验的,结果要unset就不给了,我想知道如何取消掉readonly

刚开始学shell编程。新手,多多关照。
谢谢!!!
作者: bjgirl    时间: 2003-06-20 19:18
标题: 如何取消readonly??
出于安全的原故,只读变量是不可以被复位/取消的!
作者: 红袖添香    时间: 2003-06-21 03:05
标题: 如何取消readonly??
原帖由 "SickWorm" 发表:
我设置了一个变量为readonly,在shell下作试验的,结果要unset就不给了,我想知道如何取消掉readonly

刚开始学shell编程。新手,多多关照。
谢谢!!!
   


多矛盾啊,
既然你要更改它,
怎么当初设它为 readonly ?
作者: SickWorm    时间: 2003-06-21 09:25
标题: 如何取消readonly??
原帖由 "红袖添香" 发表:
   


多矛盾啊,
既然你要更改它,
怎么当初设它为 readonly ?
   


哎呀,就是边看书边试验的,结果也没提醒说不能取消的,等我做完,才发觉问题出来了。

没办法,谁叫咱是新手呢!!
作者: deathcult    时间: 2003-06-22 00:03
标题: 如何取消readonly??
readonly: readonly [-anf] [name ...] or readonly -p
    The given NAMEs are marked readonly and the values of these NAMEs may
    not be changed by subsequent assignment.  If the -f option is given,
    then functions corresponding to the NAMEs are so marked.  If no
    arguments are given, or if `-p' is given, a list of all readonly names
    is printed.  An argument of `-n' says to remove the readonly property
    from subsequent NAMEs.  The `-a' option means to treat each NAME as
    an array variable.  An argument of `--' disables further option
    processing.
作者: anonimousboy    时间: 2003-06-23 07:49
标题: 如何取消readonly??
原帖由 "deathcult"] 发表:
or readonly -p
    The given NAMEs are marked readonly and the values of these NAMEs may
    not be changed by subsequent assignment.  If the -f option is given,
    then functions corresponding ..........

真羡慕能看到MAN的帮助~~哎~~




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2