[comp.sys.hp] indir and #!

award@uafhp.uark.edu (Sven Thjostarsson) (12/18/90)

I am trying to install indir on an HP 375.  I have gotten it to compile,
but when I try to execute a script like:

#!/usr/local/bin/indir some list of arguments

My shell reports to me that the file cannot be executed.  Is there
something I need to do to enable this or is it not supported under
HP-UX?

Thanks in advance,

Sven

rsh@hpfcdc.HP.COM (Scott Holbrook) (12/19/90)

> I am trying to install indir on an HP 375.  I have gotten it to
> compile, but when I try to execute a script like:

> #!/usr/local/bin/indir some list of arguments

> My shell reports to me that the file cannot be executed.

As documented in exec(2) (talking about #! scripts):

    If the initial line of the script exceeds a system defined
    maximum number of characters, exec fails.  The minimum value
    for this limit is 32.

Indeed, the limit in HP-UX is 32 characters.  My guess is that your
line is exceeding this limit.

> Is there something I need to do to enable this or is it not
> supported under HP-UX?

There is no way that you can change the 32 byte limit.  You can either
shorten your first line (perhaps move 'indir' to someplace with a
shorter path), or make the script a sh(1) script that simply runs

    /usr/local/bin/indir some list of arguments

Scott Holbrook / rsh@hpfcla.fc.hp.com
HP-UX Development Lab

rvdp@cs.vu.nl (Ronald van der Pol) (12/19/90)

award@uafhp.uark.edu (Sven Thjostarsson) writes:


>I am trying to install indir on an HP 375.  I have gotten it to compile,
>but when I try to execute a script like:

>#!/usr/local/bin/indir some list of arguments

>My shell reports to me that the file cannot be executed.  Is there
>something I need to do to enable this or is it not supported under
>HP-UX?

	Use the following syntax for setuid shellscripts:
	
	#!/usr/local/bin/indir -u
	#?/bin/sh /usr/local/bin/setuid_shellscript
	#
	# here starts your shellscript
	#

	Other options for indir(1) are -g, -n and -b.
	(see the manual page)

--
		Ronald van der Pol  <rvdp@cs.vu.nl>