[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20050713: minor LDM/scour bug



Hi David,

> To: Unidata Support <address@hidden>
> From: David Wojtowicz <address@hidden>
> Subject: minor LDM/scour bug
> Organization: UIUC
> Keywords: 200507131348.j6DDmijo028742 LDM scour

The above message contained the following:

> Just noticed that in LDM 6.3.0 the scour script gets installed  
> without a "#!/bin/sh" at the top.   If sh (bash) isn't your default  
> shell for the account, the script barfs.  For most people, bash would  
> be their default shell, but that is not always the case, such as  
> here, where all accounts use tcsh for their default shell.  On other  
> OS's  besides linux, it may not run the script at all without a #!

The scour(1) script doesn't have "#!" as its first characters because
that's unnecessary and can cause problems.  The scour(1) script is
intended to be executed by the ldmadmin(1) script via the command
"ldmadmin scour", which uses the system(3) function to execute the
scour(1) script.  The system(3) function invokes the standard shell
interpreter of the operating system (usually -- but not necessarily --
/bin/sh) via the execve(2) function and redirects the shell's standard
input stream to the scour(1) script.  The scour(1) script is written
according to the Shell Command Language Standard -- which (interestingly
enough) says that interpreters are not obligated to honor the common
"#!" convention.

Rather than add a (possibly incorrect) pathname of the standard shell
interpreter to the top of the scour(1) script, a better solution would
be to add a blank line to the top of the scour(1) script to accomdate
csh(1)-users who execute the scour(1) script directly.

> David Wojtowicz, Sr. Research Programmer, Sysadmin
> Dept of Atmospheric Sciences / Computer Services
> University of Illinois at Urbana-Champaign
> address@hidden  (217) 333-8390

Regards,
Steve Emmerson

> NOTE: All email exchanges with Unidata User Support are recorded in the
> Unidata inquiry tracking system and then made publicly available
> through the web.  If you do not want to have your interactions made
> available in this way, you must let us know in each email you send to us.