Bug 6176

Summary: hush: no readonly for globals
Product: Busybox Reporter: Denis.Ryndine
Component: OtherAssignee: unassigned
Status: RESOLVED INVALID    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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".