mks ksh problems with backquoted commands to be put into variables?

mks ksh problems with backquoted commands to be put into variables?

Post by bin » Sat, 23 Oct 2004 01:21:18



Hi,
I'm trying to migrate a COMPLEX UNIX-application to Windows2003,
basically using our shell scripts from unix, converted (mostly
regarding the names of called scripts. e.g. rather *.ksh than *.bat)
and my experience from the migration we did 5 years ago to winNT (with
mks for kornshell and hamilton-csh).

The newer version now on w2k3 is MKS Toolkit for Developers 8.7.0200
seems to have problems with things like

TMPSYS=`uname -s | cut -c 1`

that is: calling some commands, often using pipes to process the
outputs and then putting the result into a variable to be used for
further decisions, sometimes fails resulting in an empty string!.

I managed to get "nondeterministic" results from such scripts, that is
running a testscript which does 1000 times (sequentially) the same
thing some times fails, which I controlled via the
stderr-debug-listing produced by ksh -vx.

any ideas?
It might be some problem of the server itself I have to admit, some
configuration regarding memory/processes/..., I'm not the
win-administrator-type.

I just want to exclude any known bugs or undocumented variables to be
set (of the TK_DO_NOT_whatsoever=1 type ...)

thanks a lot!

 
 
 

mks ksh problems with backquoted commands to be put into variables?

Post by Michael Heimin » Sat, 23 Oct 2004 08:13:10



Quote:> Hi,
> I'm trying to migrate a COMPLEX UNIX-application to Windows2003,
[..]
> The newer version now on w2k3 is MKS Toolkit for Developers 8.7.0200
> seems to have problems with things like
> TMPSYS=`uname -s | cut -c 1`

Fill in a bug report to the authors?

[..]

Quote:> any ideas?

Migrate the app to Linux, could be a matter of typing make.;)

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: 0xEDD27B94)

#bofh excuse 157: Incorrect time synchronization

 
 
 

mks ksh problems with backquoted commands to be put into variables?

Post by Janis Papanagno » Sat, 23 Oct 2004 09:05:15




>>I'm trying to migrate a COMPLEX UNIX-application to Windows2003,

>>The newer version now on w2k3 is MKS Toolkit for Developers 8.7.0200
>>seems to have problems with things like

>>any ideas?

> Migrate the app to Linux, could be a matter of typing make.;)

A bit less radical would be to switch to cygwin, since the OP is asking
for a solution to a windows port.

Janis

 
 
 

mks ksh problems with backquoted commands to be put into variables?

Post by bin » Sat, 23 Oct 2004 18:55:38




> > Migrate the app to Linux, could be a matter of typing make.;)
> A bit less radical would be to switch to cygwin, since the OP is asking
> for a solution to a windows port.

Janis got it right: the customer refuses to change to UNIX-whatsoever,
all the others run on AIX, Linux or Unixware (to be moved to Linux
sooner or later), so I have no chance (as the customer is to big to be
sent to hell :-)
The salesperson agreeing in WinNT 5 years ago is no longer part of our
company so no chance for revenge either :-(

So it has to be using Unix-scripts ksh+csh the way they are or changed
automatically (as we do with awk now for mks and hamilton-csh on
WinNT) to be used on w2k3.

Thanks,
bine

 
 
 

mks ksh problems with backquoted commands to be put into variables?

Post by Michael Heimin » Sun, 24 Oct 2004 04:56:32



[..]

Quote:> So it has to be using Unix-scripts ksh+csh the way they are or changed
> automatically (as we do with awk now for mks and hamilton-csh on
> WinNT) to be used on w2k3.

So fill in a bug report to the authors, as I already suggested in
my first reply to your OP.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: 0xEDD27B94)

#bofh excuse 271: The kernel license has expired

 
 
 

1. remsh script - putting output of more than one command / variable on one line

Hiya,

How would i put the output of more than one command on one line in a
remsh scripts?

i.e on the following line i want it to output the $num before the
output from the grep command so i can pipe it into a log file...

while read num; do
super run_as_jspsab remsh ux001.$num -n "grep ACTIVITY /usr/adm/ovnlo
g" &
done < /home/users/jsdldc/jspldc/allbranches > ./ontime.log

e.g

xxxx sabfo291 IF199 sabfo291: OVERNIGHT ACTIVITY REPORT

Thanks

Sukh.

2. war eagle SCO Servers

3. How to put command output into a variable?

4. X clocks not working in SLS0.98, they worked with 0.96c ....

5. Assign the result of a command to a variable (ksh)

6. Schedule for KDevelop2 ?

7. how to apply variable command in ksh?

8. kernel-2.4.16 breaks lo interface & eth0

9. KSH question on variables and relation to the exec command

10. Need semi-non-trivial example of an (MKS) ksh script [really programming-by-example]

11. ksh: Need to read variables into variables

12. Getting csh to preserve trailing blanks from backquoted commands.

13. Using a variable in a variable name in KSH