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
FrobTADS 0.11 (Interpreter branch) iBot Software Releases - RSS News 0 04-15-2008 02:50 AM
FrobTADS 0.10 (Interpreter branch) iBot Software Releases - RSS News 0 04-01-2008 12:20 PM
When I am writing my own interpreter... Legend986 High Level Programming 34 11-08-2007 01:15 PM
bad interpreter: Permission denied earnstaf UNIX for Dummies Questions & Answers 7 07-19-2007 07:17 PM
/bin/sh: bad interpreter: Permission denied Calum Shell Programming and Scripting 4 05-06-2003 09:14 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 07-08-2005
ckeith79 ckeith79 is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 2
#!/usr/bin/ksh Command Interpreter in a sh script

Hi,

I have a developer that is trying to start a script with sh "scriptname". In the script, he is specifying #!/usr/bin/ksh as the command interpreter. For some reason sh is ignoring the #!/usr/bin/ksh. We are running Solaris 8. Does anyone have any ideas what could be causing this? Here is the script:

#!/usr/bin/ksh



#--create test file to read

#

echo "1" > test_file

echo "2" >> test_file

echo "3" >> test_file



#--WHILE READ should populate variables when shell contains #!/usr/bin/ksh

#

record_cnt=0

initial="OUTSIDE"



while read record ##--placed into $record

do

record_cnt=`expr $record_cnt + 1`

initial="INSIDE"

echo "Records Read=$record_cnt”

done < test_file ##--input file to be read



echo " "

echo "Records Read=$record_cnt"

echo "Initial=$initial"



exit 0
  #2 (permalink)  
Old 07-08-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,123
sh is ignoring it because it's a comment. Feeding a ksh script into sh like that is not the correct thing to do. But if you do it, sh will attempt to run it. Read our faq article on this subject.
  #3 (permalink)  
Old 07-08-2005
ckeith79 ckeith79 is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 2
Thanks, Perderabo. Can you post the link for the FAQ?
  #4 (permalink)  
Old 07-08-2005
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
Here you go. But the FAQ is just a click away, why not look through the entire FAQ and see what other interesting things you can pick up?
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:52 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