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

Re: dash-as-bin-sh



On Tuesday 20 April 2010 09:57:14 Wes Garland wrote:
> 1 - I there a better place to get help with dash

Not that I know of.  However, dash is fairly plain when it comes to POSIX-
compliant shells.  It handles the stuff POSIX requires it to plus the "local" 
keyword (which Debian requires of it) and that is about it.

> 2 - Is there way to detect that a script is running as dash, instead of a
> shell like Solaris' /bin/sh

Not portably.  It might be possible by parsing ($SHELL -V -c 'exit 123') or 
($SHELL --version -c 'exit 123').

> 3 - Corollary to #2, can I expect dash-as-sh to by a hard link or a sym
> link?   (I would think not, but don't know Debian's policy here)

I think it is via symlink.  I don't think it uses the alternatives system.

> 4 - Reason for #2, is there a way to list all functions declared in a
>  script with dash?  Under Solaris' shell, bash, or the korn shell I can use
>  "typeset" -- I've searched POSIX and don't see a way that doesn't involve
>  parsing the script.

Sorry, I don't even see a good way to tell if a function with a particular 
name is defined, but less list all the functions in the current shell 
environment.

Bash is still an essential package last I checked.  You might simply use 
/bin/bash and whatever bash-isms you like.
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: