LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2013, 09:17 PM   #1
oshin159
LQ Newbie
 
Registered: Nov 2013
Posts: 6

Rep: Reputation: Disabled
How can i change the shell executing my shell script ?


Hi,
I am facing a problem,i m using Ubuntu 12.04 and the default shell on which i am working is bash.Though i specified in the interpreter line in the shell program to use Bourne Shell it is still working with Bash,i even tried to run it this way-
sh sample.sh
But in vain,it is only executing the Bash Shell
What should i do?
 
Old 11-11-2013, 09:47 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,876
Blog Entries: 1

Rep: Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997Reputation: 1997
I am not an Ubuntu user so I suppose it is possible they alias sh to bash.

On the other hand, how do you know it is spawning a bash shell? And how did you specify it to use sh instead?
 
Old 11-11-2013, 10:21 PM   #3
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,362

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by oshin159 View Post
Hi,
I am facing a problem,i m using Ubuntu 12.04 and the default shell on which i am working is bash.Though i specified in the interpreter line in the shell program to use Bourne Shell it is still working with Bash,i even tried to run it this way-
sh sample.sh
But in vain,it is only executing the Bash Shell
What should i do?
Hi, Please check the output of
Code:
ls -l /bin/sh
. I think its a soft link to /bin/bash only in your system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Executing a Shell Script mmhs Linux - Newbie 2 07-15-2012 08:40 AM
different way of executing shell script vaibhavs17 Linux - Newbie 3 07-11-2012 07:11 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 08:58 PM
Can't change shell in plink shell script? lhouk Programming 2 08-02-2007 03:47 PM
executing a shell script from C llama_meme Programming 2 04-01-2002 10:10 PM


All times are GMT -5. The time now is 03:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration