Verified on Jammy (pkg: 1.0.0~beta.2-1ubuntu0.2):
Confirmed the version is ksh and the new package from -proposed:
```
root@jammy:/tmp/ksh-tests# dpkg -l | grep ksh
ii ksh93u+m 1.0.0~beta.2-1ubuntu0.2
amd64 AT&T KornShell
root@jammy:/tmp/ksh-tests# which ksh
/usr/bin/ksh
root@jammy:/tmp/ksh-tests# which ksh93
/usr/bin/ksh93
root@jammy:/tmp/ksh-tests# readlink -f /usr/bin/ksh
/usr/bin/ksh93
root@jammy:/tmp/ksh-tests# readlink -f /usr/bin/ksh93
/usr/bin/ksh93
root@jammy:/tmp/ksh-tests#
```
Run the test case:
```
root@jammy:/tmp/ksh-tests# cat testcase.sh
#!/bin/ksh
function called_function_ext {
echo "In function_ext: int_typeset_declared_in_func_exported:
${int_typeset_declared_in_func_exported}"
}
function call_from_main {
typeset -i int_typeset_declared_in_func_exported=444
export int_typeset_declared_in_func_exported
echo "In call_from_main: int_typeset_declared_in_func_exported:
${int_typeset_declared_in_func_exported}"
called_function_ext
}
call_from_main
root@jammy:/tmp/ksh-tests# ksh ./testcase.sh
In call_from_main: int_typeset_declared_in_func_exported: 444
In function_ext: int_typeset_declared_in_func_exported: 444
```
Execute it directly (with shebang it should use ksh):
```
root@jammy:/tmp/ksh-tests# chmod +x testcase.sh
root@jammy:/tmp/ksh-tests# ./testcase.sh
In call_from_main: int_typeset_declared_in_func_exported: 444
In function_ext: int_typeset_declared_in_func_exported: 444
```
Execute from within the ksh shell:
```
root@jammy:/tmp/ksh-tests# ksh
# pwd
/tmp/ksh-tests
# ./testcase.sh
In call_from_main: int_typeset_declared_in_func_exported: 444
In function_ext: int_typeset_declared_in_func_exported: 444
# ls -l
total 8
-rwxr-xr-x 1 root root 34 Sep 14 10:25 s1.sh
-rwxr-xr-x 1 root root 440 Sep 14 10:46 testcase.sh
# ksh93 ./testcase.sh
In call_from_main: int_typeset_declared_in_func_exported: 444
In function_ext: int_typeset_declared_in_func_exported: 444
#
```
Everything works as expected.
** Tags removed: verification-needed verification-needed-jammy
** Tags added: verification-done verification-done-jammy
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2110614
Title:
[SRU] Honour attributes for local assignments in subshells
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2110614/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs