Ksh problem.

From: Rob Wilson <rawilson_at_subcorp.com.au>
Date: Mon, 28 Sep 1998 10:35:17 +0930

Another question for you guys and gals...

The following scripts/files produce different results when run under sh and ksh. Do you have any ideas on how to make the ksh script work?

We are running DU4.0B with Parch Kit0008.

Cheers
Rob Wilson
Australian Submarine Corporation



File q
------
ASCE_ONLINE
FIN_ONLINE
MRP_BATCH
MRP_ONLINE
MRP_PROD
PICK_ONLINE
WRKORD_ONLINE
cscs_dev
cscs_long
cscs_monthly
cscs_short
ddds_adhoc_ZS
ddds_batch_ZL
ddds_xmtil_ZS
default
general_00MSM
general_PAL
general_PAS
sims_xfer_00XLM
single_DAL
single_DAS
single_PAL
single_PAS
tcs_PAS

---------------
file z (shell is changed from sh to ksh to produce problems)
------

#!/bin/sh (or #!/bin/ksh)

cat q | awk '{print $1}'

echo ------
doobey=`head q`
echo ${doobey}
echo ------
for i in ${doobey}
do
    echo Im here
done
echo ------

------------

Output with sh
--------------

ASCE_ONLINE
FIN_ONLINE
MRP_BATCH
MRP_ONLINE
MRP_PROD
PICK_ONLINE
WRKORD_ONLINE
cscs_dev
cscs_long
cscs_monthly
cscs_short
ddds_adhoc_ZS
ddds_batch_ZL
ddds_xmtil_ZS
default
general_00MSM
general_PAL
general_PAS
sims_xfer_00XLM
single_DAL
single_DAS
single_PAL
single_PAS
tcs_PAS
------
ASCE_ONLINE FIN_ONLINE MRP_BATCH MRP_ONLINE MRP_PROD PICK_ONLINE WRKORD_ONLINE c
scs_dev cscs_long cscs_monthly
------
Im here
Im here
Im here
Im here
Im here
Im here
Im here
Im here
Im here
Im here
------


Output with ksh
----------------

^[]2;^G^[]2;^GASCE_ONLINE
FIN_ONLINE
MRP_BATCH
MRP_ONLINE
MRP_PROD
PICK_ONLINE
WRKORD_ONLINE
cscs_dev
cscs_long
cscs_monthly
cscs_short
ddds_adhoc_ZS
ddds_batch_ZL
ddds_xmtil_ZS
default
general_00MSM
general_PAL
general_PAS
sims_xfer_00XLM
single_DAL
single_DAS
single_PAL
single_PAS
single_PAS
tcs_PAS
^[]2;^G^[]2;^G------
^[]2;^G^[]2;^G^[]2;^G^[]2;^G
^[]2;^G------
^[]2;^G------
^[]2;^G
Received on Mon Sep 28 1998 - 01:09:01 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT