@Eli,

I can recreate your problem, but it looks to me like a bug in ksh. ksh
complains that 'local can only be used in a function, when as shown
below it *is* being used in a function.'

My suggestion is to file a bug with ksh2020.


root@focal1:~# ksh -c 'foo() { local a=1; echo $?; }; foo'
ksh: local: local can only be used in a function
1

root@focal1:~# ksh2020 -c 'foo() { local a; echo $?; }; foo'
ksh2020: local: local can only be used in a function
1

also oddly, ksh seems to report itself in '$SHELL' as /bin/sh.


root@focal1:~# /usr/bin/ksh2020  -c 'foo() { local a=1; echo $?; }; echo 
$SHELL; foo'
/bin/sh
/usr/bin/ksh2020: local: local can only be used in a function
1

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1784713

Title:
  cloud-init profile.d files use bash-specific builtin "local"

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1784713/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to