ksh on UNIX and Linux | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

ksh on UNIX and Linux

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-30-2013
rdogadin rdogadin is offline
Registered User
 
Join Date: Oct 2013
Last Activity: 30 December 2013, 4:53 PM EST
Posts: 15
Thanks: 10
Thanked 0 Times in 0 Posts
ksh on UNIX and Linux

Hello,

Would the same version of Korn Shell (let's say ksh93) would use the same syntax on UNIX and LINUX and work exactly the same? Thanks
Sponsored Links
    #2  
Old 10-30-2013
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 24 October 2014, 4:42 PM EDT
Location: Switzerland - GE
Posts: 5,835
Thanks: 162
Thanked 415 Times in 390 Posts
I remember the times when you were taught shell basics, and so was pure sh for compatibility, it is also true for ksh... things may change when it comes to advanced features and extensions where it may differ depending of implementation ( and so KSH93 or KSH88 with posix extension...) ... In other words if your shellscript is pure standard ksh it has no reason to not be compatible between UNIX variants or LINUX so sticking to old syntax will almost always work, recent fany extension may give surprises...
addendum
I stick to old ksh to be sure I have no problem when copying my scripts from HP-UX to Solaris or AIX thought its more AIX to solaris and linux now... (AIX has ksh93 ( the server I squat I upgraded to 7.1 so not sure about the other releases...) HP-UX 11.11 is not KSH93 nor is Solaris 10 ksh)

Last edited by vbe; 10-30-2013 at 11:55 AM.. Reason: addendum
The Following User Says Thank You to vbe For This Useful Post:
rdogadin (10-30-2013)
Sponsored Links
    #3  
Old 10-30-2013
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 25 October 2014, 12:38 PM EDT
Location: Amsterdam
Posts: 9,549
Thanks: 285
Thanked 2,427 Times in 2,175 Posts
Many enhancements have been made to ksh93, over the years. If you use the same version of ksh93 on all platforms ( ksh --version will tell you) you should not have compatibility problems on different platforms (unless mentioned in de man page ( printf "%T()" comes to mind..). If you stick with the original ksh93 syntax, your script should work with any ksh93 version, including the /usr/dt/bin/dtksh that is present by default on some of the UNICES .

Last edited by Scrutinizer; 10-30-2013 at 01:55 PM..
The Following User Says Thank You to Scrutinizer For This Useful Post:
rdogadin (10-30-2013)
    #4  
Old 10-30-2013
rdogadin rdogadin is offline
Registered User
 
Join Date: Oct 2013
Last Activity: 30 December 2013, 4:53 PM EST
Posts: 15
Thanks: 10
Thanked 0 Times in 0 Posts
Thank you guys. This is very helpful.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh script in Linux ilugopal Shell Programming and Scripting 3 01-07-2013 01:11 PM
clear in Linux ksh pradebban Linux 2 05-26-2011 02:21 PM
Newline charachter in Ksh-Linux Sanju1236 Shell Programming and Scripting 3 01-18-2010 04:06 PM
Need to cut filename in LINUX ksh juliyp Shell Programming and Scripting 10 06-09-2009 09:38 AM
Script Migration From HP to Linux (KSH) Omkumar Shell Programming and Scripting 1 09-02-2005 09:44 AM



All times are GMT -4. The time now is 06:07 PM.