Problems with ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problems with ksh
# 8  
Old 11-11-2010
What do people think about using [[ ]] in ksh and the posix stuff???? What I like in ksh is that I can do floating point calculations easily.
# 9  
Old 11-11-2010
Sure your not using ksh93? Cause both ksh and pdksh don't support floating point
# 10  
Old 11-11-2010
which ksh is giving /usr/bin/ksh

I know the old ksh dopes not do computations, however ksh93 does. I'm using Fedora 8, which says it does not have ksh. Got no clue!!!! Smilie Smilie
# 11  
Old 11-11-2010
A lot of OSes have replaced the default ksh with ksh93.
Run:
Code:
/usr/bin/ksh -c 'echo ${.sh.version}'

if you get an output with version information, its ksh93.

Quote:
What do people think about using [[ ]] in ksh and the posix stuff????
I would go with [[ ]] and (( )). I usually don't care about the POSIX compatibility. In my opinion, unless you are creating a commercially distributable product, you should be fine.
# 12  
Old 11-11-2010
Getting Version M 1993-12-28 s+
# 13  
Old 11-11-2010
That is ksh93
# 14  
Old 11-12-2010
Quote:
Originally Posted by a_programmer
...In my opinion, unless you are creating a commercially distributable product, you should be fine.
Agreed, it's a matter of thinking where is this script likley to run?

If you're writing an install script (or the like) that could be run on a number of different OS's then POSIX is the only way to go. Buy for a script that you run on your own servers it's not such a big deal. Worst case here is if you upgrade to a new server that dosn't support ksh93, someone (you might have left by that stage) will either have to update your scripts or get ksh93 installed on the new box.

But, you can bet they will be saying "The previous guy wrote all these damn scripts that do heaps of floating poing stuff with ksh93 and now we have to re-write them to use bc!", lol.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problems with ksh array and find command

set -A allfiles `find $usrhtml -type f` i am trying to populate this array with the find command. It works fine when find is looking through a single directory but when i add a new subdirectory the files in the subdirectory get duplicated. Can anyone help me and fix this so each files in... (1 Reply)
Discussion started by: bjhum33
1 Replies

2. UNIX for Dummies Questions & Answers

Difference Between executing llike ./myscript.ksh and . ./myscript.ksh

Hi , What is the diffence between executing the script like ./myscript.ksh . ./myscript.ksh I have found 2 difference but could not find the reason 1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in... (5 Replies)
Discussion started by: max_hammer
5 Replies

3. Solaris

Problems Running KSH on Solaris 10

Hi, I am currently in the process of testing upgrading from Solaris 8 to Solaris 10. one problem i have encountered is when i am running any of my batch scripts. All my scripts start with #! /bin/ksh so that they will excuted in the ksh shell. but the scripts will not run correctly. The... (3 Replies)
Discussion started by: dshakey
3 Replies

4. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

5. Shell Programming and Scripting

autosys/ksh - problems with script

Hi, I'm using autosys and want to set it up that I receive emails when certain jobs start and finish. I don't want to edit each jobs script (ksh) to send a mail at start and finish, I would rather have a single script/job that watches for a trigger when the jobs have started or finished. I... (1 Reply)
Discussion started by: weszardoz
1 Replies

6. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

7. Shell Programming and Scripting

Strange parameter passing problems (KSH)

Hi all, I'm having a rather peculiar problem involving parameter passing with declared functions in my shell script. Hope to get some advice here. A brief description of my code is as follows: However, I'm not getting the results I wanted. If I pass in $rdir, I'm going to end up... (4 Replies)
Discussion started by: rockysfr
4 Replies

8. Shell Programming and Scripting

Problems with Perl/KSH Web Log Script

Hi, I am writing a series of scripts for work to analyse intranet access logs. All of the scripts do as they should when run individually from the shell, but only when run from certain directories. This sounds like it may be a PATH issue but I am not sure. When I run a certain script, say... (3 Replies)
Discussion started by: mmanders
3 Replies

9. UNIX for Advanced & Expert Users

'make' problems (compliation problems?)

I'm trying to compile and install both most recent version of 'make' and the most recent version of 'openssh' on my Sparc20. I've run into the following problems... and I don't know what they mean. Can someone please help me resolve these issues? I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies

10. UNIX for Dummies Questions & Answers

having ksh script problems

well i have written a script to telnet and ftp to all my servers, the script runs great, BUT i can not for the life of me figure out how to get the script to repeat if the conditions are not filled. this is what i have so far ######################################### TorF(){ echo T... (4 Replies)
Discussion started by: jerzey4life
4 Replies
Login or Register to Ask a Question