Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jan 1996 14:14:28 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-chat@freebsd.org
Cc:        JSINNOTT@pomona.edu
Subject:   Re: BASH shell script question..
Message-ID:  <199601061314.OAA13251@uriah.heep.sax.de>
In-Reply-To: <9601060555.AA08315@emu.fsl.noaa.gov> from "Sean Kelly" at Jan 5, 96 10:55:41 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Sean Kelly wrote:
> 
> Yes.  Just make the script the login shell in the password file for
> the user in question.  As root, use vipw or chpass -s to change the
> login shell to the full pathname of the script.  Make sure the script
                                                   ^^^^^^^^^^^^^^^^^^^^
> is executable.  That's it.
  ^^^^^^^^^^^^^^

This translates into ``the script must be an "interpreted
executable"''.  I.e., you have to use

#!/usr/local/bin/bash

as the first line of your script, in addition to setting the
appropriate x-permissions.  Without this, execve(2) won't accept the
script as an executable program.  (For a normal shell environment,
this is the point where your login shell jumps in and feeds the script
into some sort of a shell.  This doesn't work for a login program
however.)


-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601061314.OAA13251>