ksh: zero divisor error when declaring a variable -
update: weird. looked further, , realized there 2 *ksh
packages in server:
pdksh-5.2.14-37.el5_8.1.x86_64 mksh-39-7.el6_4.1.x86_64
and mksh
set in /etc/alternatives
:
lrwxrwxrwx 1 root root 9 apr 23 10:39 /etc/alternatives/ksh -> /bin/mksh
i pointed /bin/pdksh
, tried script again, , worked.
to replicate issue, changed /bin/mksh
, time, script worked without error. in short, not replicate issue anymore. weird.
i'm looking further. thanks.
given korn shell script:
#!/bin/ksh u=$1
with $1
passed abc/s0mething
, how can work around error?
ksh: abc/s0mething 0 divisor.
ksh version:
@(#)mirbsd ksh r39 2009/08/01
thanks.
it's weird, if asking workaround, can be
u=`printf '%q' $1`
however, not able replicate problem on system understand it... if doesn't work, shall remove answer.
Comments
Post a Comment