Thread View: gnu.bash.bug
4 messages
4 total messages
Started by Andy Galewsky
Fri, 09 Feb 1990 23:53
BASH and Bourne Shell scripts
Author: Andy Galewsky
Date: Fri, 09 Feb 1990 23:53
Date: Fri, 09 Feb 1990 23:53
14 lines
1007 bytes
1007 bytes
I hope I'm not just being stupid (it has happened before) but - when I am running BASH-1.04 and I try to execute a Bourne shell script - I can't get /bin/sh to execute it -- BASH tries to do it. I have tried putting #!/bin/sh as the first line of the shell script - but BASH continues to try to execute it - itself. It doesn't seem right that I have to throw away all of my old shell scripts in order to run BASH. This is probably not a BASH bug - but just a problem with my understanding of how this works. Thanks Andy Galewsky Clinical Resource Systems peyote!sneffels!andy galew_a@peyote.cactus.org
BASH and Bourne Shell scripts
Author: Brian Fox
Date: Wed, 21 Feb 1990 05:15
Date: Wed, 21 Feb 1990 05:15
27 lines
1613 bytes
1613 bytes
Date: 9 Feb 90 23:53:27 GMT From: milano!peyote!galew_a@cs.utexas.edu (Andy Galewsky) Organization: Capital Area Central Texas Unix Society, Austin, TX Sender: bug-bash-request@prep.ai.mit.edu I hope I'm not just being stupid (it has happened before) but - when I am running BASH-1.04 and I try to execute a Bourne shell script - I can't get /bin/sh to execute it -- BASH tries to do it. I have tried putting #!/bin/sh as the first line of the shell script - but BASH continues to try to execute it - itself. It doesn't seem right that I have to throw away all of my old shell scripts in order to run BASH. This is probably not a BASH bug - but just a problem with my understanding of how this works. Thanks Andy Galewsky Clinical Resource Systems peyote!sneffels!andy galew_a@peyote.cactus.org System V machines don't pay attention to #! in the first line. Their fault, not yours. If the system call exec () didn't exec the file, then bash assumes that the file is a bash script. Not a bad assumption, and in fact, the same assumption that /bin/sh makes. Brian
Re: BASH and Bourne Shell scripts
Author: Bill Trost,Box 607,ext 640,
Date: Fri, 23 Feb 1990 20:45
Date: Fri, 23 Feb 1990 20:45
10 lines
785 bytes
785 bytes
>If the system call exec () didn't exec the file, then >bash assumes that the file is a bash script. Not a bad assumption, and >in fact, the same assumption that /bin/sh makes. What, the Bourne shell assumes files are bash scripts when exec() fails? Nahhhh... :-) :-) :-) :-) :-) :-) :-) :-) Just filling up the net....
Re: BASH and Bourne Shell scripts
Author: Andrew Vignaux
Date: Tue, 27 Feb 1990 08:59
Date: Tue, 27 Feb 1990 08:59
52 lines
2249 bytes
2249 bytes
In article <9002210515.AA12755@sbphy.Ucsb.EDU>, bfox@sbphy.mit.edu
(Brian Fox) writes:
>
> From: milano!peyote!galew_a@cs.utexas.edu (Andy Galewsky)
>
> I hope I'm not just being stupid (it has happened before) but - when I am
> running BASH-1.04 and I try to execute a Bourne shell script - I can't get
> /bin/sh to execute it -- BASH tries to do it.
> [...]
>
> System V machines don't pay attention to #! in the first line. Their
> fault, not yours.
I hope I wont be classed as a heritic, but after half an hour of
a) loving bash 1.04, but
b) working on a system which doesn't accept #!, and
c) having bash run scripts itself, but
d) the bash echo and the system's echo having different sematics
I added the following patch. Not very nice, or pretty and certainly
NOT OFFICIAL!!
I define XSHELL=/bin/sh in my .bashrc and all the system scripts work
like they used to :-)
A slightly more substantial patch would probably try to do the #!
stuff itself if XSHELL was defined.
*** execute_cmd.c.orig Fri Nov 3 21:11:24 1989
--- execute_cmd.c Tue Feb 20 13:20:19 1990
***************
*** 902,907 ****
--- 902,916 ----
if (args[0][0] == '-')
args[0]++;
+ {
+ char * last_chance_shell = get_string_value ("XSHELL");
+ if (last_chance_shell) {
+ execve (last_chance_shell, args, export_env);
+ report_error ("%s: Cannot execute %s", shell_name, last_chance_shell);
+ exit (EXECUTION_FAILURE);
+ }
+ }
+
exit (main (larry, args, export_env));
}
}
Andrew
--
Domain address: Andrew.Vignaux@comp.vuw.ac.nz
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads