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

Re: About standards and politics



On Wed, 18 Aug 1999, Birger Langkjer wrote:

> Obviously the script works better like this:

you only want the script to work if ${EDITOR} is defined.

if [ -z "${EDITOR}" ]; then
	exec /bin/vim $@
fi

> vi:
> 
> #!/bin/sh
> echo "Do you want to use ${EDITOR} instead of vi? y/n"
> read edit
> if [ "$edit" = "y" -o "$edit" = "Y" ]; then
>         exec $EDITOR $1

no, you want exec $EDITOR $@ . It's possible that the user could provide
more than one argument.

>         exec vi $1

you also want the full pathname here, eg /bin/vim

-- 
Donovan