Bug 6176 - hush: no readonly for globals
Summary: hush: no readonly for globals
Status: RESOLVED INVALID
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-08 09:19 UTC by Denis.Ryndine
Modified: 2013-04-21 14:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis.Ryndine 2013-04-08 09:19:45 UTC
BusyBox v1.20.2 (2013-04-04 13:18:53 UTC) hush - the humble shell


The frist two below won't 'compile', the third one with local readonly is ok.

readonly MYSLEEP=1
mysleep() {
  sleep $MYSLEEP
}
mysleep

mysleep() {
  readonly MYSLEEP=1
  sleep $MYSLEEP
}
mysleep

#won't mind local
mysleep() {
  local readonly MYSLEEP=1
  sleep $MYSLEEP
}
mysleep
Comment 1 Denys Vlasenko 2013-04-21 14:25:12 UTC
hush does not have "readonly" builtin.

"local readonly MYSLEEP=1" would declare a local variable named "readonly", and another variable named "MYSLEEP".