The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing the values to the secondary script when it invoked by primary script venu_eie UNIX for Advanced & Expert Users 2 07-03-2008 07:10 AM
Passing the values to the secondary script when it invoked by primary script venu_eie Shell Programming and Scripting 1 07-03-2008 06:16 AM
create a shell script that calls another script and and an awk script magikminox Shell Programming and Scripting 0 06-26-2008 02:50 AM
help me in sending parameters from sqlplus script to unix shell script Hara Shell Programming and Scripting 2 01-29-2008 03:31 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-29-2008
kumars kumars is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 9
Script help

Hi there to everyone,

I am new to shell script and I am in the need to develop and run scripts on the AIX. I am using 'ksh' on AIX .

Could anyone please tell me what should be file extension for the script on 'ksh' and how to compile it.

I mean the script ext. should be...

filename.ksh or filename.csh, etc,......

and how to compile it.
  #2 (permalink)  
Old 08-29-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,754
The name of the file is up to the standards you have for your system. Ususally coders use filename.sh. Unix is not Windows so it doesn't care about file extensions.

To make the code run under ksh do two things

1. change script to have a shebang "#!" as the VERY FIRST line in the script
Code:
#!/bin/ksh
2. change permissions on the file - in this example we call the script filename.sh
Code:
chmod +x filename.sh
to run the script, just type the name of the script file and press return.
  #3 (permalink)  
Old 08-29-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by kumars View Post
Hi there to everyone,

I am new to shell script and I am in the need to develop and run scripts on the AIX. I am using 'ksh' on AIX .

Could anyone please tell me what should be file extension for the script on 'ksh' and how to compile it.

I mean the script ext. should be...

filename.ksh or filename.csh, etc,......

There is no need for any file extension or suffix (on *nix, they are not really extensions).

I use a suffix of "-sh" for the development versions of my scripts. When they are ready to use, I copy them to the production directory (usually /usr/local/bin) without the suffix. That way, I can play around with the develoopment copy while keeps a pristine production version. (I have scripts for this in the last chapter of my book, Shell Scripting Recipes.)
Quote:

and how to compile it.

You do not compile shell scripts. All you need to do is set the execute permissions:

Code:
chmod +x /path/to/script
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0