Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: installing executable functions



On Saturday 30 of January 2010 03:36:45 Bart Schaefer wrote:
> On Jan 29,  9:54pm, Peter Stephenson wrote:
> }
> } ("sed -ne '1p'" is in case there's some ghastliness where "head -1"
> is } broken as has occasionally been observed with "tail -1".)
> }
> } The biggest disadvantage here is this could make function
> installation } on some systems, notably Cygwin, even more
> interminable.
> 
> Perhaps this would be faster?
> 
>   if test -n "`sed -ne 2q -e '/^#!/p' $sdir_top/$file`"; then
> 
> } +    if sed -ne '1p' $sdir_top/$file | grep '^#!' >/dev/null; then

Hmm ... to completely avoid fork?

read -r line < $sdir_top/$file
case "$line" in
    '#!'* )
		chmod +x $instdir/`echo $file | sed -e 's%^.*/%%'`
	;;
esac

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



Messages sorted by: Reverse Date, Date, Thread, Author