From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id FAA18505 for ; Fri, 12 Jul 1996 05:56:48 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA27665; Thu, 11 Jul 1996 15:14:35 -0400 (EDT) Resent-Date: Thu, 11 Jul 1996 15:12:56 -0400 (EDT) From: mkwong@dacsoup.ih.lucent.com Original-From: mkkwong@lucent.com Original-From: mkwong@dacsoup.ih.lucent.com Message-Id: <9607111909.AA21511@dacs75b.ih.lucent.com> Subject: Q: Can we force a different shell interpreter for scripts To: zsh-users@math.gatech.edu Date: Thu, 11 Jul 1996 14:09:23 -0500 (CDT) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"AEkUN.0.Ml6.o8Lvn"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/286 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I could not (did I overlook?) find an answer in the faq nor the manual. Any advice is appreciated. What follows is an explanation of why I need the answer: I like zsh and it is my default shell. But the unix environment I am working in uses ksh and all my colleagues are satisfied with that and don't want to change. Many tools in the form of shell scripts have been developed over the years -- and all these scripts are ksh scripts. No one bothered to specify something like "#!ksh" in the first line of all these scripts because ksh automatically uses ksh to interpret scripts (zsh uses ONLY sh unless there is an interpreter specified in the first line of the script). Now when I call one of these scripts from my zsh, zsh interprets the script as a Bourne shell and more often than not the script breaks because it contains a ksh command not understood by the Bourne shell. To workaround that, I must type "ksh command" instead of just "command". For some of the more frequently used "command", I make an alias for "ksh command". But there are hundreds of such commands; I get tired of making aliases. Besides, I do not have a complete list of which commands need the "ksh" prefix. But the most difficult situation is that some of the old, established ksh scripts in our environment are invoked by sourcing them in the current working shell, like ". command". Issuing the same ". command" from my zsh does not work because such a command usually invokes 10, 20 other ksh scripts, and each one will break the script when run in zsh. The first solution I thought of was to make a local copy of these scripts and modify them to run in my zsh, such as adding "ksh" in front of all the commands invoked. Then I discover that some of the scripts have more than 200O lines of code, and I gave up. Besides, many of these scripts are still being actively maintained (because of changes in the working environment, like new files, or new directories being added from time to time) and very often changes are made without public announcements. My problem will be solved if there is an option in zsh, say SCRIPT_SHELL=ksh, which I can set so that all scripts invoked in that zsh are interpreted by ksh (or may be zsh) instead of by zh. But I cannot find such an option. Is there another workaround? mk kwong Lucent Technologies