The UNIX and Linux Forums  

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
running a shell script from another ali560045 Shell Programming and Scripting 1 11-12-2008 11:36 AM
shell script not running vakharia Mahesh UNIX for Advanced & Expert Users 3 09-17-2008 10:00 PM
Running from Shell Vs running from RC script vickylife SUN Solaris 2 07-31-2008 10:01 AM
Need to know rhe PID for the Shell Script running pbsrinivas Shell Programming and Scripting 7 01-25-2007 09:10 AM
running shell script from sqlplus dkr123 Shell Programming and Scripting 9 07-20-2006 11:52 PM

Reply
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 06-16-2009
dr46014 dr46014 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 95
running a shell script

sometimes while running a shell script we use ksh -c '....script'
what is the significance of ksh -c here ....
what if i run the script only.what is the difference
  #2 (permalink)  
Old 06-16-2009
jayan_jay jayan_jay is offline
Registered User
  
 

Join Date: Jul 2008
Location: Chennai
Posts: 40
-C Prevent existing files from being overwritten by
the shell's > redirection operator; the >|
redirection operator will override this
noclobber option for an individual file.

Refer "man ksh" for more info
  #3 (permalink)  
Old 06-16-2009
methyl methyl is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1,184
-c is the parameter to state the location of the shell script to be run.
If there are no other parameters on the line, the -c is assumed.
See the "Invoking ksh" section of "man ksh".
  #4 (permalink)  
Old 06-16-2009
dr46014 dr46014 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 95
Quote:
Originally Posted by methyl View Post
-c is the parameter to state the location of the shell script to be run.
If there are no other parameters on the line, the -c is assumed.
See the "Invoking ksh" section of "man ksh".
I could not understand the answer.I am running couple of commands through one application.I am gettinng some error when directly using the commands but it gets executed when i am using ksh -c '..my commands...'
  #5 (permalink)  
Old 06-17-2009
methyl methyl is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1,184
And the commands are .... the errors are ... ?
  #6 (permalink)  
Old 06-17-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,938
Quote:
Originally Posted by methyl View Post
-c is the parameter to state the location of the shell script to be run.
Sorry but that statement is incorrect.

From ksh93 man page

Code:
     -c       If  the  -c option is present, then commands are
               read from the first arg.   Any  remaining  argu-
               ments  become  positional parameters starting at
               0.

From pdksh man page

Code:
    -c command-string
        The shell executes the command or commands contained in command-
        string.

From ksh88 man page

Code:
-c string
    If the -c flag is present then commands are read from string.

  #7 (permalink)  
Old 06-17-2009
methyl methyl is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 1,184
We need to see the script which is failing and to know the default shell.
In the context of running a single script with parameters "ksh -c" and the ksh command prompt are interchangeable. This case must be more complicated.
Reply

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 07:35 PM.


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