Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 7084 - Cannot create read only variables.
Summary: Cannot create read only variables.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: pdksh
Version: 6.1
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-11-17 19:23 UTC by Hemant Shah
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-04-06 15:01:05 UTC


Attachments (Terms of Use)

Description Hemant Shah 1999-11-17 19:23:41 UTC
I recently bought RedHat 6.1 Professional version.
Yesterday I upgraded my system to redhat Linux 6.1. Many of my shell
scripts stopped working because they contained "typeset -r"
commands.

Example:
---------------------------------------------------------------
#!/bin/ksh

typeset -r ExeName=${0##*/}
typeset -r NiceOpt=""
print $ExeName
date
---------------------------------------------------------------

When I execute above script I get following message:

/tmp/tst.ksh[3] ExeName: is read only
/tmp/tst.ksh[4] NiceOpt: is read only

Wed Nov 17 11:09:06 CST 1999


As you can see ExeName is not set.

Here is the output of uname -a before upgrade:
Linux lidp14 2.0.34 #21 Thu Apr 29 12:22:41 CDT 1999 i586 unknown

Here is th output of uname -a after upgrade:
Linux lidp14 2.2.12-20 #1 Mon Sep 27 10:25:54 EDT 1999 i586 unknown

Please respond ASAP, all my administrative scripts are not working.

Thanks.

Hemant Shah, LIDP Inc.
E-mail: shahhe@lidp.com
 Voice: +1 630 829 7064
   Fax: +1 630 960 0717

Comment 1 Trond Eivind Glomsrxd 2000-04-06 15:01:59 UTC
I don't think you can assign at the same time you set the "-r" attribute - do it
like this instead:

ExeName=${0##*/}
NiceOpt=""
typeset -r ExeName
typeset -r NiceOpt
print $ExeName


Note You need to log in before you can comment on or make changes to this bug.